added solutions for problem 1 in python, c++, and java