← Back to challenges

Box Completely Filled?

JavaScriptHardstringsformattingvalidation

Instructions

Create a function that checks if the box is completely filled with the asterisk symbol *.

Examples

completelyFilled([
  "#####",
  "#***#",
  "#***#",
  "#***#",
  "#####"
]) ➞ true

completelyFilled([
  "#####",
  "#* *#",
  "#***#",
  "#***#",
  "#####"
]) ➞ false

completelyFilled([
  "###",
  "#*#",
  "###"
]) ➞ true

completelyFilled([
  "##",
  "##"
]) ➞ true

Notes

  • Boxes of size n <= 2 are considered automatically filled (see example #4).
  • Empty space will always be a space character (" ").
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Likes vs. Dislikes