For each line: (ignoring case)
1. Replace every occurence of "pg" with "gp"
2. Replace every occurence of "egp" with "epg"
3. Replace every occurence of "gpuk" with "pguk"
But I realize this will not work too well if the strange rule is supposed to be applied recursively as well. Could someone tell me what the output for
is supposed to be. Also, why is there a special correction judge for this problem!?pppgegppp ppvpgegpvpvp
pggggguk eggppuk