Roblox interview question

Some dynamic programming question and a sliding door problem