Bloomberg Interview Question

Candy Crush 1D program in terms of string