Amazon interview question

Snake and Ladder problem from Leetcode Project related questions