Code:
#include
#include
int main(){
std::string str;
std::cin>>str;
int len {str.length()};
std::string fstr {};
fstr.append(str, 0, 1);
std::cout<<fstr<<'\n';
for(int i=0; i<len-1; i++){
fstr.append(std::to_string(str[i+1] - str[i]));
fstr.append(str, i+1, 1);
}
std::cout<<fstr<<'\n';
return 0;
}
This was my solution code to :difference in ascii code" probelm and it did not pass. I had the correct answer to the test case as well as other cases that I unlocked.
Please let me know why the code didn’t pass.
Thanks