Skip to content

Invalid test case in stone-game #4444

@max-dekock

Description

@max-dekock

Bug Report for https://neetcode.io/problems/stone-game

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


According to the description of Stone Game, there should be an even number of piles. However, there's a test case with an odd number of piles:

piles=[100,200,300,400,101]

Furthermore, if Alice goes first with this configuration, then with optimal play, Bob always wins. But the auto-grader expects a value of true. This is probably because all the example code uses the parity of the number of piles left to determine whose turn it is.

Image 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