You are viewing a single comment's thread. Return to all comments →
when you have already sorted, you dont need to take the absolute value, just saying
lowestDiff = abs(nums[i+1]-nums[i])
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 →
when you have already sorted, you dont need to take the absolute value, just saying