Last active
May 17, 2019 21:07
-
-
Save jgsamudio/e65e78942263a16f8f4a59951976cc92 to your computer and use it in GitHub Desktop.
CodeJam - "You Can Go Your Own Way" Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); | |
int t = in.nextInt(); | |
for (int i = 1; i <= t; ++i) { | |
int gridSize = in.nextInt(); | |
String otherPersonPath = in.next(); | |
String path = ""; | |
for (int j=0; j<otherPersonPath.length(); j++) { | |
char stepChar = otherPersonPath.charAt(j); | |
if (stepChar == 'E') { | |
path += "S"; | |
} else { | |
path += "E"; | |
} | |
} | |
System.out.println("Case #" + i + ": " + path); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment