Google interview question

Snake and ladder on Leetcode type question