My issue
i AM NOT ABLE TO UNDERSTAND THE QUESTION
My code
#include <stdio.h>
int main(void) {
// your code goes here
}
Problem Link: Spell Shortening Practice Coding Problem - CodeChef
i AM NOT ABLE TO UNDERSTAND THE QUESTION
#include <stdio.h>
int main(void) {
// your code goes here
}
Problem Link: Spell Shortening Practice Coding Problem - CodeChef
@jasmitha_16
plzz refer my c++ code for better understanding of the logic
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string s;
cin>>s;
int ch=0;
string ans;
for(int i=1;i<n;i++)
{
if(s[i-1]>s[i]&&!ch)
{
ch=1;
}
else
ans+=s[i-1];
}
if(ch)
ans+=s[n-1];
cout<<ans<<endl;
}
}