Whats the Time Complexity?

class Solution {
public int numIdenticalPairs(int[] nums) {
int i=0;
int j=nums.length-1;
int count=0;
while(i<j){
if(nums[i]==nums[j]){
count++;
}
j--;
if(j==i){
i++;
j=nums.length-1;
}
}
return count;
}
}

Comments (1)