Why this code Show time limit exceed

please give the solution using array in java

public boolean containsDuplicate(int[] nums) {
    for(int i=0;i<nums.length;i++){
        for(int j=i+1;j<nums.length;j++){
            if(nums[i]==nums[j]){
                return true;
            }else{
                continue;
            }

        }
    }
    return false;
    
}

}

Comments (2)