Bloomberg Interview Question

Q: Write an algorithm to solve Candy Crush on one dimensional axis.