Roblox Interview Question

Leetcode hard backtracking/dynamic programming problem