Solved 20 and 25
optimized problem 2