import java.util.ArrayList;import java.util.Scanner;public class VIDEOGAME {public static void main(String[] args) {Scanner s = new Scanner(System.in);int n, h, pointer = 0;n = s.nextInt();h = s.nextInt();ArrayList<Integer> list = new ArrayList<Integer>();// Entering no of elements in each stackfor (int i = 1; i <= n; i++)list.add(s.nextInt());int command = s.nextInt();boolean ifBox = false;while (command != 0) {switch (command) {case 1:if (pointer > 0) {pointer--;}break;case 2:
Read more… (24 words)