Question: can someone please help me to write this logic. here input needs to be read from scanner class and i am not able to understand

Description Given a directed acyclic graph (DAG) of n nodes labeled from 0 ton-1, count all possible paths from node O to noden - 1, and return the number of paths. The graph is given as follows: graph[i) is a list of all nodes you can visit from node i (.e., there is a directed edge from node i to node graph[i][]). Example: 0 1 2 3 Input: graph = [[1,2],[3),(3,01 Output: 2 Explanation: There are two paths: 0-> 1 -> 3 and 0 -> 2 -> 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
