prob 5 2 solutions mine is super slow the other one is fast