Lucid Software Interview Question

The algorithm for candy crush.