All challenges

Saturday, 3 October 2026

Past

Three rungs, one idea. Solving rung 1 counts. Climb as far as you can.

Drawing Boxes

loops + rows of characters

Rung 1Daily goal5 points

A solid square

Write a function called solid_box

Return a list of strings that draws a filled square of # characters. A size of 2 gives ["##", "##"] — two rows, each two characters wide. A size of 0 returns an empty list.

Examples

InputOutput
2["##", "##"]
1["#"]
0[]
3["###", "###", "###"]

There are extra hidden tests, so make it work in general, not just for these.

Rung 2Bonus7 points

Empty in the middle

Write a function called hollow_box

Same square, but only the edge is drawn and the inside is spaces. A size of 3 gives ["###", "# #", "###"]. The first and last rows are still solid, and sizes of 1 and 2 have no inside at all.

Examples

InputOutput
3["###", "# #", "###"]
1["#"]
2["##", "##"]
0[]

There are extra hidden tests, so make it work in general, not just for these.

Rung 3Bonus10 points

Any shape you like

Write a function called hollow_rect

Now the height and the width can differ, so 3, 4 gives ["####", "# #", "####"]. Watch the thin ones: a width of 1 makes every row just "#", because there is no room for a gap. If the height or the width is 0, return an empty list.

Examples

InputOutput
3, 4["####", "# #", "####"]
1, 4["####"]
3, 1["#", "#", "#"]
0, 5[]

There are extra hidden tests, so make it work in general, not just for these.

Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.