Added cpp solution