Leetcode 2441. Largest Positive Integer That Exists With It's Negative
Intuition
Sort the array and check if the start and end of the array match. If not, increment or decrement accordingly.
Approach
First sort the array. Then use two pointers. One at the beginning, the other at the end. Check to see if the value at the...
blog.kennycarneal.com1 min read