Rewritten Problem 2a into a shorter version

Version 1 was too verbose.
Added premature optimization to Problem 2a

Not sure if it's _really_ premature, but it feels like a natural
addition to not get stuck in a loop :)
Added Problem 4a