Ambiguous Crushing Rules


  • 0
    F

    It is annoying that the crushing rules are ambiguous.
    0_1509949415507_918d0adf-fe10-4202-9441-2206e30591e2-image.png
    What does it mean by 'adjacent vertically or horizontally'?

    In the illustrated example:
    0_1509949528743_0a8c0271-151f-423d-92ad-5ad1e7b4c87e-image.png

    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
    L

    "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
    F

    @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
    0_1509994573881_fc8d6d3b-2eeb-45d1-b4fb-eb47267a9ef2-image.png

    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
    F

    @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.