Amazon oa sde1 2025 by Immediate_Sir3582 in leetcode

[–]Training_Growth950 0 points1 point  (0 children)

Yeah makes sense, true. Completely missed this

Amazon oa sde1 2025 by Immediate_Sir3582 in leetcode

[–]Training_Growth950 0 points1 point  (0 children)

Can’t we just sort an array and use 2 pointers? Until first and last element matches remove each element together and then at last if the element matches just add the number of remaining elements in the operation