import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
long c=n;
String s="";
while(c>0){
long d=c%10;
long f=9L-d;
if(f>0&&f<d){
s=Long.toString(f)+s;
}
else{
s=Long.toString(d)+s;
}
c=c/10;
}
System.out.print(Long.parseLong(s));
}
}
Whats the error? One testcase failing
for 99
output should be 90
Try to debug with this