This one is not working for one test case , please help


#1

public class Solution {
public int[] plusOne(int[] A) {
int n=A.length;
for(int i=n-1;i>=0;i–)
{
if(A[i]<9){
A[i]++;
return A;
}
A[i]=0;

    }
    int[] new_num=new int[n+1];
    new_num[0]=1;
    return new_num;
}

}