Maximal Network Rank

You are given n cities labeled 0 through n - 1 and a list of roads, where roads[i] = [a, b] means cities a and b are directly connected by an undirected road. There are no duplicate roads.

The network rank of two different cities a and b is the total number of roads directly connected to either city. If a road connects a and b directly, it counts toward both, so it is subtracted once:

rank(a, b) = degree(a) + degree(b) - [a and b are directly connected]

Return the maximal network rank over all pairs of different cities.

Examples
Input: [4,[[0,1],[0,3],[1,2],[1,3]]]
Output: 4
Hints

Maximal Network Rank

You are given `n` cities labeled `0` through `n - 1` and a list of roads, where `roads[i] = [a, b]` means cities `a` and `b` are directly connected by an undirected road. There are no duplicate roads.