The algorithm has three phases per round:
Mark:: Find all horizontal and vertical runs of + same candies. Mark them for removal.
Crush:: Remove all marked candies (set to or empty).
Drop:: Apply gravity. Each column's candies fall to fill empty spaces. Repeat until no candies are marked. The greedy aspect: crush everything possible before dropping. Common bug: crushing one match at a time instead of all at once can miss cascading matches. Time: . Space: .