Question 21
EasyWhich technique solves 'container with most water' efficiently?
- A.
Sorting the heights
- B.
Recursion over all pairs
- C.
A hash set
- D.
Two pointers starting at both ends, moving the shorter side inwards
Sign up free to see the answer and a step-by-step explanation.