Company: Groww_10dec
Difficulty: medium
Recursion: Remove Edge Problem Description You are given a directed graph of N nodes and M edges, and two distinct nodes A and B . For any node X , you can only remove edges that are incoming towards X . Find the minimum number of edges to be removed from node B so that node A can no longer reach node B through any path. Note: If there is no path from A to B in the given graph, you should return 0. You can only remove edges that are incoming to node B . Input Format The first line contains two integers, N (denoting the number of nodes) and M (denoting the number of edges). The second line contains two integers, A and B . The next M lines each contain two integers, X and Y , representing a directed edge from node X to node Y . Output Format The output should be a single integer representing the minimum number of edges to be removed from B so that A cannot reach B through any path. Constraints 1 <= N <= 105 1 <= M <= 105 1 <= X, Y <= N A != B Sample Input 9 11 1 3 1 2 2