Loading Similar Posts
string decode(string p) {
// Write your code here.
int n=0;
string ans;
for (int i = p.length() - 1; i >= 0; --i) {
char a = p[i];
int myInt = a - '0';
n = n * 10 + myInt;
if ((n >= 65 && n <= 90) || (n >= 97 && n <= 122) || n == 32) {
ans =ans+ static_cast<char>(n);
n = 0;
}
}
return ans;
}