A visualization tool is provided to allow you to watch your program play. To use this tool, you must adapt your solution to read input from standard in and write output to standard out. Each time move is called, you should read the four parameters in the same order that they are presented to your method. To read each of the two string arrays, you should first read in its length, on a line by itself. The elements will then be given to you, one per line. To read in the completed parameter, you should simply read a single line with four numbers on it, separated by spaces. Finally, you should read a line with a single integer, position. After reading the input, you should write your move on a line by itself:
while(true){ N = parseInt(nextLine()); stacks = new string[N]; for(int i = 0; i<N; i++){ stacks[i] = nextLine(); } M = parseInt(nextLine()); String[] deck = new String[M]; for(int i = 0; i<M; i++){ deck[i] = nextLine(); } int[] completed = new int[4]; sp = nextLine().split(' '); for(int i = 0; i<4; i++) completed[i]= parseInt(sp[i]); position = parseInt(nextLine()); println(move(stacks,deck,completed,position)); }Once you have adapted your solution, you will need to download and install the visualizer. You can download an executable jar or you can get the source. In addition, you will have to download and extract the card images. Once you have placed all these files, along with your executable in the same directory, you can run the visualizer with something like the following command: