added c++, java, and python solutions for problem 2