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.*; | |
public class Solution{ | |
private static Scanner sc; | |
private static int[] inputList = new int[26]; | |
private static int[] visited = new int[26]; // tells me if I've visited a character as well as its index to which stack it belongs to in the listOfStacks | |
private static List<Stack<Character>> listOfStacks = new ArrayList<Stack<Character>>(); | |
private static int indexAfterLastStack = 1; // points to empty slot to insert a new stack | |
private static List<ArrayList<Character>> setOfLists = new ArrayList<ArrayList<Character>>(); |