Citadel interview question

The first round problem is a graph problem. They also asked me about the time complexity.