Add solution for problem 3

Renamed from problem to Problem for consistency.