What is error in my code--------------
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
int n = cin.nextInt(),count = 0;
while(n>0){
n = n /10;
count++;
}
int arr[] = new int[count];
int m = arr.length -1;
while(n>0){
int d = n%10;
arr[m] = d;
n = n / 10;
m–;
}
for(int i = 0;i<arr.length;i++){
if(9-arr[i]<arr[i]){
arr[i] = 9-arr[i];
}
}
for(int s: arr){
System.out.print(s);
}
}
}