MakeBricks is a favorite CodingBat problem I created for CodingBat. It's deeper than it appears at first. I've received lots of baffled email about this problem over the years, so here I'll try to walk through how to think about it.

Here's the original problem statement: We want to make a row of bricks that is goal inches long. We have a number of small bricks (1 inch each) and big bricks (5 inches each). Return true if it is possible to make the goal by choosing from the given bricks. This is a little harder than it looks and can be done without any loops.

Practice Code Problems

Here's the live MakeBricks and the slightly more difficult MakeChocolate problems:
makeBricksmakeChocolate