Medium
There are n cities and some undirected roads given as edges. The network rank of two different cities is the total number of roads directly connected to either city; a road connecting both counts only once. Return the maximum network rank over all pairs of cities.
Input: n = 4, edges = [[0,1],[0,3],[1,2],[1,3]] Output: 4
Input: n = 5, edges = [[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]] Output: 5