You are viewing a single comment's thread. Return to all comments →
in the if segment lowestDiff = abs(nums[i+1]-nums[i]) we dont need abs as the list is already sorted
Seems like cookies are disabled on this browser, please enable them to open this website
Closest Numbers
You are viewing a single comment's thread. Return to all comments →
in the if segment lowestDiff = abs(nums[i+1]-nums[i]) we dont need abs as the list is already sorted