Problem 15 solved.
A more concise way to solve it.