Skip to content

Bug Report for max-water-container (missing test case) #4861

@willdonovancode

Description

@willdonovancode

Bug Report for https://neetcode.io/problems/max-water-container

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
class Solution:
def maxArea(self, heights: List[int]) -> int:
longest=0

    L=0
    R=len(heights)-1

    while L<R:
        total=min(heights[L],heights[R])
        mult=R-L
        total*=mult
        longest=max(total,longest)
        if heights[L]>R:
            R-=1
        else:
            L+=1
    
    return longest

this passes the test case and it shouldnt.
it just happens that the values are less than the length of the list i guess

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions