Making a Box

Published by Helen Yu in

Create a function that creates a box based on dimension n.

Examples

makeBox(5) ➞ [
  "#####",
  "#   #",
  "#   #",
  "#   #",
  "#####"
]

makeBox(3) ➞ [
  "###",
  "# #",
  "###"
]

makeBox(2) ➞ [
  "##",
  "##"
]

makeBox(1) ➞ [
  "#"
]

Notes

N/A

Watch a quick demo on how Edabit works.