GO Solution For UVa 10301 - Rings and Glue. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

Little John is in big trouble. Playing with his different-sized (and colored!) rings and glue seemed such a good idea. However, the rings now lay on the floor, glued together with some-thing that will definitely not come off with water. Surprisingly enough, it seems like no rings are actually glued

...

You can find the full details of the problem Rings and Glue at UVa Online Judge

Sample Input

4
0.0 0.0 1.0
-1.5 -1.5 0.5
1.5 1.5 0.5
-2.0 2.0 3.5
3
3.0 2.0 2.0
0.0 -0.5 1.0
0.0 0.0 2.0
5
-2.0 0.0 1.0
1.0 -1.0 1.0
0.0 1.0 0.5
2.0 0.0 1.0
-1.0 1.0 1.0
-1

Sample Output

The largest component contains 4 rings.
The largest component contains 2 rings.
The largest component contains 3 rings.

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985