Microsoft interview question

DFS shortest bridge problem from leetcode ( medium )