GO Solution For UVa 154 - Recycling. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

Kerbside recycling has come to New Zealand, and every city from Auckland to Invercargill has leapt on to the band wagon. The bins come in 5 different colours — red, orange, yellow, green and blue — and 5 wastes have been identified for recycling — Plastic, Glass, Aluminium, Steel, and Newspaper. Obv

...

You can find the full details of the problem Recycling at UVa Online Judge

Sample Input

r/P,o/G,y/S,g/A,b/N
r/G,o/P,y/S,g/A,b/N
r/P,y/S,o/G,g/N,b/A
r/P,o/S,y/A,g/G,b/N
e
r/G,o/P,y/S,g/A,b/N
r/P,y/S,o/G,g/N,b/A
r/P,o/S,y/A,g/G,b/N
r/P,o/G,y/S,g/A,b/N
ecclesiastical
#

Sample Output

1
4

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

Solution originally posted at: Github by @codingsince1985