Add Solution To Problem 1 In Java