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

Problem Description

Bart’s sister Lisa has created a new civilization on a two- dimensional grid. At the outset each grid location may be oc- cupied by one of three life forms: Rocks, Scissors, or Papers. Each day, differing life forms occupying horizontally or vertically adjacent grid locations wage war. In each war,

...

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

Sample Input

3
3 3 1
RRR
RSR
RRR
3 4 2
RSPR
SPRS
PRSP
10 10 10
SSSSSRRRRR
PPPPPPPPPP
PSPSPSPSPS
PRPRPRPRPR
RPRPRPRPRP
PPPPPRRRRR
SSSSSRRRRR
RRSPRRSPRR
PPPSSSSSSS
SSSSSSSSSS

Sample Output

RRR
RRR
RRR

RRRS
RRSP
RSPR

SSRPPSPSPS
SRSRPRSRSR
RPRPRPRPRP
SSSSSSSPSP
SSSSRSSPPP
SRSRPRSSPR
RPRPSSSSSP
PSPRSSPRSS
SSRPSPRPSP
PSSRPRSRPR

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

Solution originally posted at: Github by @codingsince1985