Pergunta de entrevista da empresa Lenovo

Backtracking and Greedy algorithm leetcode question.