Double-Degree Array

http://rosalind.info/problems/ddeg/

Source: Algorithms by Dasgupta, Papadimitriou, Vazirani. McGraw-Hill. 2006.

Given: A simple graph with n≤103 vertices in the edge list format.

Return: An array D[1..n] where D[i] is the sum of the degrees of i's neighbors.

See Figure 1 for visual example from the sample dataset.