Pregunta de entrevista de Canva

A back-tracking algorithm problem, medium difficulty on LeetCode