TikTok interview question

A medium level leetcode backtrack problem