Added naive and smarter solution to problem1