Hint: Use a map.
Warning: The input file is not well-formed and has some empty lines, which you will want to ignore.
3367 Expressions (3)
Hint: Compute the coordinates of each node first. Then, use the union-find data structure.
Find the root, divide-and-conquer.
Hint: Use the path compression idea we talked about while covering the union-find data structure.
2274 The Race (6)
3321 Apple Tree (6)
1175 Picture (7, challenge problem)
1195 Mobile phones (8, challenge problem)
2750 Potted Flower (9, challenge problem)