Domanda di colloquio di Bloomberg

Was asked a stack based Algo and a backtracking question.