Skip to content

Bug Report for majority-element #5484

@AnonymousAnion

Description

@AnonymousAnion

Bug Report for https://neetcode.io/problems/majority-element

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

Include the test case [6,5,5] or any one where the first element is one count off from being the majority element. The test cases for submission miss detecting an off by one error when the first element is accidentally counted twice - a common mistake if a programmer accidentally starts their for loop at the beginning but also initialized count to one and the majority element to the first element.

Image

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