Two test cases fail i don't know why pls help me

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
ArrayList l = new ArrayList();
String no = sc.next();

	int sum = 0;

	// 139263
	for (int i = 0; i < no.length(); i++) {
        int num =Character.getNumericValue(no.charAt(i));
        sum = 9-(num);
        
        if(sum<num) {
        	l.add(sum);
        }
        else {
        	l.add(num);
        }
        
	}
	for (Object object : l) {
		System.out.print(object);
	}
}

}

@nigamshubham1998,
Your code will give a wrong answer for the following input:

Input:
92
Correct output:
92
Your output:
02

It is also mentioned in the question The decimal representation of the final number shouldn’t start with a zero.

@nigamshubham1998,
Similarly if for the input:

Input:
999
Correct output:
900
Your output:
000

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.