Added Solution for problem 1, 2, 3

Problem 1, 2, 3 solution
(brute and elegant)