Skip to content

Brute force submissions checker is broken for sliding-window-maximum #6118

Description

@mcmcgovern

Bug Report for https://neetcode.io/problems/sliding-window-maximum

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

I think better detection for when a brute force solution is being tested is necessary. Part of the interview and problem solving process involves coming up with a brute force solution, this is one key way to confirm we are solving the right problem.

The way that the submissions checker works right now, there are some test cases designed to fail for a brute force solution. I think this is fine for making sure users can push harder for optimal solution and not settle for the brute force variant, but it leaves a huge gap in being able to determine whether a brute force solution is correct or not. With problems like sliding-window-maximum, even while using the included brute force solution #1 from the solution tab it causes a submission to fail and I think this is incorrect behavior.

A simple solution to correct this would be to tag certain unit tests so they are known to fail for a brute force solution. That way we don't have to waste a lot of compute making sure they will pass for brute force, but also don't leave users confused about why a correct brute force solution isn't passing.

I suspect this issue is present in many Neetcode problems.

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