Ambiguous Crushing Rules

  • 0

    It is annoying that the crushing rules are ambiguous.
    What does it mean by 'adjacent vertically or horizontally'?

    In the illustrated example:

    Why is board[8][0] not crushed? How to explain that the red crushing region on the right is a legit crush?

    This rule is apparently different from the one in Candy Crush mobile game. What is it? I am very confused.

  • 1

    "If three or more candies of the same type are adjacent vertically or horizontally, "crush" them all at the same time - these positions become empty."

    8,0 doesn't have 3 or more 1's horizontally or vertically

  • 0

    @livelearn Yes, that is my second guess which is:

    A candy is crushed if and only if there are at least three candies (including itself) of the same number adjacent one by one on a vertical line or a horizontal line.

    This rule makes sense in the illustrated example. However, after I code it up according to this rule, I got

    Maybe my code has a fallacy. Maybe I misunderstand the rule again. I don't know. But the ambiguity of the rule is frustrating.

  • 0

    @livelearn Thank you for the help!

    My second guess is the correct rule (as you also said). I found the typo in my code and got accepted.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.