Given an undirected graph with n nodes and a list of edges, return the degree of each node (the number of edges incident to it) as an array indexed by node. The input is JSON {n, edges}.
Input: JSON {n, edges}.
Output: Array — the degree of each node.
Input: {"n":5,"edges":[[0,1],[0,2],[1,3],[2,4]]}
Output: [2,2,2,1,1]
Explanation: Incident edge counts.Input: {"n":1,"edges":[]}
Output: [0]
Explanation: Isolated node.Input: {"n":3,"edges":[[0,1],[1,2],[2,0]]}
Output: [2,2,2]
Explanation: Triangle: each degree 2.1<=n<=10^5undirected