Lucid Software interview question

The algorithm for candy crush.