Some accepted solutions fail on certain edge cases because they don’t properly handle arrays where all elements are the same or where negative numbers are included. These cases are not covered in the ...
If an out-of-bounds exception is thrown, then the two text cases from hitting run pass. int current = 1; for(int i = 1; i <= nums.length; i++){ if(!(nums[i] == nums ...