I appeared for Flipkart coding test day before yesterday and got stuck on this problem:<br>↵
You are given an undirected weighted graph with n vertices and m edges. In one move you can make any edge weight zero. You can perform atmost K moves. You have to tell what is the shortest path from a starting node A to an ending node B after performing atmost K moves.<br>↵
1<=n<=1000<br>↵
0<=K<n<br>↵
1<=m<=10000<br>↵
1<=w<=10^9 (weight of edge) <br>↵
Can anybody please tell me how to approach this problem?<br>↵
I found this problem on [quora](https://www.quora.com/Given-an-N-vertex-weighted-graph-if-we-can-change-the-weight-of-K-of-the-edges-to-zero-what-is-the-shortest-path-from-1-to-N) also but couldn't understand the approach clearly.
You are given an undirected weighted graph with n vertices and m edges. In one move you can make any edge weight zero. You can perform atmost K moves. You have to tell what is the shortest path from a starting node A to an ending node B after performing atmost K moves.<br>↵
1<=n<=1000<br>↵
0<=K<n<br>↵
1<=m<=10000<br>↵
1<=w<=10^9 (weight of edge) <br>↵
Can anybody please tell me how to approach this problem?<br>↵
I found this problem on [quora](https://www.quora.com/Given-an-N-vertex-weighted-graph-if-we-can-change-the-weight-of-K-of-the-edges-to-zero-what-is-the-shortest-path-from-1-to-N) also but couldn't understand the approach clearly.