LeetCode 11: Container With Most Water Solution

Day 9 of Daily DSA 🚀 Solved LeetCode 11: Container With Most Water ✅ 🔍 Approach: Used the two-pointer technique to efficiently calculate the maximum area. Started with pointers at both ends Calculated area using min height × width Moved the pointer with the smaller height to optimize the result This avoids brute force and ensures an optimal solution. ⏱ Complexity: • Time: O(n) • Space: O(1) 📊 LeetCode Stats: • Runtime: 5 ms (Beats 80.63%) • Memory: 77.19 MB (Beats 92.56%) A great example of how the right observation can turn a problem into a clean solution. #DSA #LeetCode #Java #TwoPointers #ProblemSolving #Consistency #DailyCoding

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories