Problem 25 completely solved
More time optimization