Company: Flipkart Grid 8.0

Difficulty: medium

Problem Statement

Shortest Path with Blocked Roads Given an undirected weighted graph, blocked edges, a source and a destination, print the least path cost using only unblocked edges, or -1 if impossible. Input Format n m; then m lines `u v w`; then k; then k blocked pairs; then `S D`. Output Format Print the least cost or -1. Constraints - 1 <= n,m <= 200000 - weights are positive

More Flipkart Grid 8.0 OA questionsInterview experiences