Design algorithm to count simple paths between two DAG vertices

Given a directed acyclic graph with vertices numbered 0 through n - 1, count directed paths from source to target. The input is a JSON string containing n, an edges array of directed pairs, source, and target. Every listed edge is a distinct edge. Parallel edges are allowed and count as distinct path choices.

Return the exact count. A zero-length path counts when source equals target. Return 0 when the target is unreachable.

Examples
Input: "{\"n\":6,\"edges\":[[0,1],[1,2],[2,3],[3,4],[4,5]],\"source\":1,\"target\":4}"
Output: 1

Design algorithm to count simple paths between two DAG vertices

Given a directed acyclic graph with vertices numbered `0` through `n - 1`, count directed paths from `source` to `target`. The input is a JSON string containing `n`, an `edges` array of directed pairs, `source`, and `target`. Every listed edge is a distinct edge. Parallel edges are allowed and count as distinct path choices.