Added C++ solution to 2