Daily challenge for 2026-06-15
531. Nodes with Single Outgoing Edge
You are given a list of directed edges representing a graph or tree, where each edge is a pair [u, v] indicating a directed edge from node u to node v. Return the number of nodes that have exactly one outgoing edge (i.e., exactly one child).
Example:Input: edges = [[0,1], [0,2], [1,3]]Output: 1
(Explanation: Node 1 has exactly one child: 3. Node 0 has two children. Nodes 2 and 3 have zero.)
Run this challenge interactively in Python or JavaScript when the app loads.