Bloomberg interview question

Program a Candy Crush algorithm in one dimension