leetle

Daily challenge for 2025-12-24

358. Count the Sink Nodes

In graph theory, a sink node is a node that has an out-degree of zero, meaning it has no outgoing edges. Given a directed graph represented as an adjacency list adj, return the total number of sink nodes in the graph.

Example:
Input: adj = {"0": [1], "1": []} Output: 1

Run this challenge interactively in Python or JavaScript when the app loads.