Loading...
Loading...
Loading...
A network has n computers and m two-way cables. Print how many cables are plugged into each computer, in order of computer number.
Example
Input
4 4 0 1 0 2 1 2 2 3
Output
2 2 3 1
Try the problem first. Open one hint at a time.
Keep a list of n counters.
Each cable adds one to the counter of both of its ends.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor