added c++ solution