It is annoying that the crushing rules are ambiguous.
What does it mean by 'adjacent vertically or horizontally'?
In the illustrated example:
board 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.
"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
@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.
@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.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.