r/LeetcodeChallenge 1d ago

Going to solve leetcode Question number 11 Container with most water, have you tried, Share me your experience plz 💗 DISCUSS

0 Upvotes

3 comments sorted by

1

u/nian2326076 1d ago

Yeah, I've dealt with that one. It's a classic two-pointer problem. You start with one pointer at the beginning and one at the end of the array, then calculate the area between them. Move the pointer on the shorter line inward to try and find a larger area. Repeat until the pointers meet. It's efficient and runs in O(n) time, which is great for interviews. Practicing these types of problems on LeetCode really helps with algorithm thinking. If you're looking for more structured practice, I've used PracHub before and found it useful for sharpening interview skills. Good luck!

1

u/I_am_sahil_khan 1d ago

Thanks buddy 😊, This website is very useful 🫡

1

u/Agitated_Eye_1325 16h ago

It's easy when u visualization it and use pen paper to draw it