Bloomberg interview question

1. 1d candy crush question ( leetcode easy )