Solve Google Code Jam "Speaking in Tongues" prob