Skip to content

Instantly share code, notes, and snippets.

import java.util.ArrayList;
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
String input ="R2, L5, L4, L5, R4, R1, L4, R5, R3, R1, L1, L1, R4,"
+ " L4, L1, R4, L4, R4, L3, R5, R4, R1, R3, L1, L1, R1, L2,"