IMC Trading Interview Question

Implement a stack BFS min moves