Clarivate Interview Question

shortest path to cycle in graph