What is wrong with this code

#include
#include
using namespace std;
int main() {
string s;
cin>>s;
for(int i=0;i<s.length();i++)
{
int a=s[i]-48;
if(a>4)
{
a=9-a;
}
s[i]= a+‘0’;
}
cout<<s;
return 0;
}

@Kunalgoyal for 999 your output 000 while ans 900 . it should not contain leading zeroes.
i hope its clear if yes dont forget to mark it as resolved :smiley: