Easiest CPP (3 liner)


#1

string Solution::solve(string A) {
string B;
stringstream ss(A);
string word;
while(ss >> word){
word += " ";
word += B;
B = word;
}
return string(B.begin(),B.end()-1);
}