Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use Breadth First Search (BFS) to traverse all possible boxes you can open. Only push to the queue the boxes the you have with their keys.
Solve with full IDE support and test cases