#include
#include ;
using namespace std;
int main() {
string s1;
cin>>s1;
int a=s1.length();
if(a>2 && a<2000) {
for(int i=0;i<a-1;i++) {
int x=s1[i+1]-s1[i];
cout<<s1[i]<<x;
}
cout<<s1[a-1];
}
return 0;
}
String Problem(two test cases are not working)
hi @Abhishek4799 the constraints are given to give you an idea about the space and time complexity expected from you, and you can be assured that you dont have to test the constraints yourself. So you can get the rid of the a > 2 && a < 1000 condition.
Anyhow, acc to the question, this condition should actually be a >= 2 && a <= 1000 (both inclusive) so make that change and the code will pass all the testcases.
In the future please save your code on ide.codingblocks.com and then share the link.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.