IMC Trading interview question

Implement a stack BFS min moves