Ask HN: How are you supposed to use LeetCode?
It probably took me 2 full hours, and I only got it with a brute force approach and a butt-load of optimization to make it efficient later.
So, anyway, then I go to the discussion tab, and that's where everyone is chatting about this really cool, elegant, O(n) solution. But it's the kind of thing you would see in a CS textbook, not just come up with on your own. And I didn't see any proofs, so I still don't know that it _really_ works. But I do see lots of examples of exactly how to implement it.
My question is; what's the point then? Are you supposed to not look at the discussion and beat your head against the wall trying to best Donal Knuth, or do you look at the discussion and then just copy it all over with your brain totally turned off? I don't get it.
Oh, here it is, in case anyone is wondering:
https://leetcode.com/problems/container-with-most-water/