Given the n x n adjacency matrix of a graph, convert it to an adjacency list: for each node, the sorted list of nodes it connects to (indices j where matrix[i][j] is 1). Return the adjacency list as a nested array. The input is JSON {matrix}.
Input: JSON {matrix}.
Output: Nested array — sorted neighbors of each node.
Input: {"matrix":[[0,1,1],[1,0,0],[1,0,0]]}
Output: [[1,2],[0],[0]]
Explanation: Neighbors read off each row.Input: {"matrix":[[0]]}
Output: [[]]
Explanation: Single node.Input: {"matrix":[[0,1],[1,0]]}
Output: [[1],[0]]
Explanation: One edge.1<=n<=1000