You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.?title=Bug Report for top-k-elements-in-list
The given two pointers solution doesn't work when heights = [3,1,1,1,1,1,1,7,1,3]. We should handle it separately when the heights are the same.
class Solution:
def maxArea(self, heights: List[int]) -> int:
l, r = 0, len(heights) - 1
res = 0
while l < r:
area = min(heights[l], heights[r]) * (r - l)
res = max(res, area)
if heights[l] <= heights[r]:
l += 1
else:
r -= 1
return res
The text was updated successfully, but these errors were encountered:
Bug Report for https://neetcode.io/problems/anagram-groups
https://neetcode.io/problems/max-water-container
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.?title=Bug Report for top-k-elements-in-list
The given two pointers solution doesn't work when
heights = [3,1,1,1,1,1,1,7,1,3]
. We should handle it separately when the heights are the same.The text was updated successfully, but these errors were encountered: