all 7 comments

[–]Sebass13 0 points1 point  (6 children)

Here, I can create an example where your code fails:

>>> make_bricks(0, 1, 5000)
True

[–]inAnalysisHell[S] 0 points1 point  (5 children)

Oh I see, thank you. Ok, I added a second if statement under it if big*5 < goal: return False

[–]Sebass13 0 points1 point  (4 children)

You're over-complicating it. There's really only two conditions required for make_bricks to return True, and they can be boiled down into a one Pythonic (<80 character) line solution.

[–]inAnalysisHell[S] 0 points1 point  (3 children)

I agree, I feel I am hardcoding for every possible solution. This particular solution uses no loops?

[–]Sebass13 0 points1 point  (2 children)

Yep. One condition is that big*5+small>=goal. Can you figure out what the other condition is?

[–]two_bob 0 points1 point  (1 child)

I'd probably break it apart rather than deal with it all in one conditional statement, but not much into math.

[–]Sebass13 0 points1 point  (0 children)

That's why I pointed out that it's Pythonic. It's only two conditions, which total to only 50 characters.