Why my Java solution didn't work out here.

  • 0

    public int removeDuplicates(int[] A) {
    int num = A[0];
    int length = A.length;

            for(int i = 1; i < A.length; i++){
                if(num == A[i]){
                    num =A[i];
            return length;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.