criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
import java.io.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Deque<Integer> dq = new ArrayDeque<Integer>();
        StringBuilder sb = new StringBuilder();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            int n = sc.nextInt();
            for(int i = 0 ; i < n ; i++){
                String command = br.readLine();
                if(command.equals("deleteFirst"))
                    dq.removeFirst();
                else if(command.equals("deleteLast"))
                    dq.removeLast();
                else{
                    String[] str = command.split(" ",1);
                    if(str[0].equals("delete"))
                        dq.remove(Integer.parseInt(str[1]));
                    else
                        dq.addFirst(Integer.parseInt(str[1]));
                }
            }
            System.out.print(dq.removeFirst());
            Iterator i = dq.iterator();
            while(i.hasNext()){
                sb.append(" " + i.next());
            }
            System.out.println(sb);
    }
}


Compiler output:
Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown
                String command = br.readLine();
                                            ^
1 error
Language: Java

import java.util.LinkedList;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		LinkedList<String> lnk=new LinkedList<String>();
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String s=sc.next();
			
			if(s.equals("deleteFirst"))lnk.remove();
			else if(s.equals("deleteLast"))lnk.removeLast();
			else  {String a=sc.nextInt();
				if(s.equals("insert"))lnk.add(a);
			else if(s.equals("delete")) lnk.remove(a);}
			
		}for(String i:lnk)System.out.println(i);
	}
}

Compiler output:
Main.java:14: error: incompatible types: int cannot be converted to String
			else  {String a=sc.nextInt();
			                          ^
1 error
Language: Java

package aizu;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class AizuALDS1_3_C {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		
		int x=Integer.parseInt(br.readLine());
		ArrayList<Integer> list=new ArrayList<Integer>();
		for (int i = 0; i < x; i++) {
			//System.out.println(list);
			String s=br.readLine();
			String[] v=s.split(" ");
			if(v[0].equals("insert")){
				int val=Integer.parseInt(v[1]);
				list.add(val);
			}else if(v[0].equals("delete")){
				int val=Integer.parseInt(v[1]);
				for (int j = 0; j < list.size(); j++) {
					if(list.get(j)==val){
						list.remove(j);
						break;
					}
				}
				
			}else if(v[0].equals("deleteLast")){
				list.remove(0);
				
			}else if(v[0].equals("deleteFirst")){
				int size=list.size()-1;
				list.remove(size);
			}
		}
		for (int i = list.size()-1; i >= 0; i--) {
			System.out.print(list.get(i));
			if(i>0)
				System.out.print(" ");
		}
		System.out.println();

	}

}

Compiler output:
Main.java:10: error: class AizuALDS1_3_C is public, should be declared in a file named AizuALDS1_3_C.java
public class AizuALDS1_3_C {
       ^
1 error
Language: Java

import java.util.Scanner;


public class Main{

	static Node head = null;

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = new Integer(s.nextLine()).intValue();
		for(int i=0 ; i<cnt ; i++) {
			String[] str = s.nextLine().split(" ");
			if("insert".equals(str[0])) {
				insert(new Integer(str[1]).intValue());
			}else if("delete".equals(str[0])) {
				delete(new Integer(str[1]).intValue());
			}else if("deleteFirst".equals(str[0])) {
				deleteFirst();
			}else if("deleteLast".equals(str[0])) {
				deleteLast();
			}
		}
		String str = "";
		while(head!=null){
			str += head.value + " ";
			head = head.nextNode;
		}
		System.out.println(str.trim());
	}

	public static void insert(int value) {
		if(head == null) {
			head = new DoubleLinkedList().new Node(value);
			return;
		}
		Node current = new DoubleLinkedList().new Node(value);
		head.previousNode = current;
		current.nextNode = head;
		head = current;
	}

	public static void delete(int value) {
		if(head == null) {
			return;
		}
		Node n = head;
		while(n != null) {
			if(n.value == value && n.nextNode!=null && n.previousNode!=null) {
				n.nextNode.previousNode = n.previousNode;
				n.previousNode.nextNode = n.nextNode;
				break;
			}else if(n.value==value && n.previousNode==null)
				deleteFirst();
			else if(n.value==value && n.nextNode==null)
				deleteLast();
			n = n.nextNode;
		}
	}

	public static void deleteFirst() {
		if(head == null)
			return;
		Node d = head.nextNode;
		head.nextNode = null;
		head = d;
	}

	public static void deleteLast() {
		if(head == null)
			return;
		Node n = head;
		while(n.nextNode != null) {
			n = n.nextNode;
		}
		n.previousNode.nextNode = null;
	}

	public class Node {
		int value;
		Node previousNode;
		Node nextNode;

		public Node(int value) {
			this.value = value;
			this.previousNode = null;
			this.nextNode = null;
		}

		public void setPreviousNode(Node node) {
			this.previousNode = node;
		}

		public void setNextNode(Node node) {
			this.nextNode = node;
		}
	}
}

Compiler output:
Main.java:10: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
		int cnt = new Integer(s.nextLine()).intValue();
		          ^
Main.java:14: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
				insert(new Integer(str[1]).intValue());
				       ^
Main.java:16: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
				delete(new Integer(str[1]).intValue());
				       ^
Main.java:33: error: cannot find symbol
			head = new DoubleLinkedList().new Node(value);
			           ^
  symbol:   class DoubleLinkedList
  location: class Main
Main.java:36: error: cannot find symbol
		Node current = new DoubleLinkedList().new Node(value);
		                   ^
  symbol:   class DoubleLinkedList
  location: class Main
2 errors
3 warnings
Language: Java

import java.util.*;
import java.io.*;

class Main {

    public static void main( String[] args ) {
        try {
	      	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
			int n = Integer.parseInt( kb.readLine( ) );        
			Deque<Integer> dq = new Deque<Integer>( );
            String[] str;
            for( int i=0; i<n; i++ ) {
                str = kb.readLine().split( " " );
                if( "insert".equals( str[0] ) ) {
                    dq.addFirst( Integer.parseInt( str[1] ) );
                } else if( "deleteFirst".equals( str[0] ) ) {
                    dq.removeFirst( );
                } else if( "deleteLast".equals( str[0] ) ) {
                    dq.removeLast(  );
                } else if( "delete".equals( str[0] ) ) {
                    dq.removeFirstOccurrence( Integer.parseInt( str[1] ) );
                }
            }
        	
			StringBuilder output = new  StringBuilder( );
            for( Iterator itr = dq.iterator( ); itr.hasNext( ); ) {
                output.append( itr.next( ) ).append( " " );
            }
            output.deleteCharAt( output.lastIndexOf( " " ) );
            System.out.println( output );
            
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
}

Compiler output:
Main.java:10: error: Deque is abstract; cannot be instantiated
			Deque<Integer> dq = new Deque<Integer>( );
			                    ^
1 error
Language: Java

import java.util.*;
import java.io.*;

class Main {

    public static void main( String[] args ) {
        try {
	      	BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
			int n = Integer.parseInt( kb.readLine( ) );        
			Deque<Integer> dq = new ArrayList<Integer>( );
            String[] str;
            for( int i=0; i<n; i++ ) {
                str = kb.readLine().split( " " );
                if( "insert".equals( str[0] ) ) {
                    dq.addFirst( Integer.parseInt( str[1] ) );
                } else if( "deleteFirst".equals( str[0] ) ) {
                    dq.removeFirst( );
                } else if( "deleteLast".equals( str[0] ) ) {
                    dq.removeLast(  );
                } else if( "delete".equals( str[0] ) ) {
                    dq.removeFirstOccurrence( Integer.parseInt( str[1] ) );
                }
            }
        	
			StringBuilder output = new  StringBuilder( );
            for( Iterator itr = dq.iterator( ); itr.hasNext( ); ) {
                output.append( itr.next( ) ).append( " " );
            }
            output.deleteCharAt( output.lastIndexOf( " " ) );
            System.out.println( output );
            
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
}

Compiler output:
Main.java:10: error: incompatible types: ArrayList<Integer> cannot be converted to Deque<Integer>
			Deque<Integer> dq = new ArrayList<Integer>( );
			                    ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;

class Elem {
	Elem next;
	Elem prev;
	int key;
	
	Elem(int key) {
		this.key = key;
	}
}

class DoubleyLinkedList {
	Elem head;
	
	DoubleyLinkedList() {
		head = new Elem(-1);
		head.next = head;
		head.prev = head;
	}
	
	void insert(int key) {
		Elem e = new Elem(key);
		e.next = head.next;
		e.prev = head;
		e.next.prev = e;
		head.next = e;
	}
	
	void delete(int key) {
		for (Elem e = head.next; e != head; e = e.next) {
			if (e.key == key) {
				e.prev.next = e.next;
				e.next.prev = e.prev;
				return e.key;
			}
		}
		return -1;
	}
	
	void deleteFirst() {
		Elem e = head.next;
		e.next.prev = head;
		head.next = e.next;
		return e.key;
	}
	
	void deleteLast() {
		Elem e = head.prev;
		e.prev.next = head;
		head.prev = e.prev;
		return e.key;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		for (Elem e = head.next; e != head; e = e.next) {
			sb.append(e.key);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		return sb.toString();
	}
}

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int n = Integer.parseInt(br.readLine());

		DoubleyLinkedList list = new DoubleyLinkedList();
		for (int i = 0; i < n; i++) {
			String[] line = br.readLine().split(" ");
			if (line[0].equals("insert")) {
				list.insert(Integer.parseInt(line[1]));
			} else if (line[0].equals("delete")) {
				list.delete(Integer.parseInt(line[1]));
			} else if (line[0].equals("deleteFirst")) {
				list.deleteFirst();
			} else if (line[0].equals("deleteLast")) {
				list.deleteLast();
			}
		}
		System.out.print(list.toString());
	}
}

Compiler output:
Main.java:37: error: incompatible types: unexpected return value
				return e.key;
				        ^
Main.java:40: error: incompatible types: unexpected return value
		return -1;
		       ^
Main.java:47: error: incompatible types: unexpected return value
		return e.key;
		        ^
Main.java:54: error: incompatible types: unexpected return value
		return e.key;
		        ^
4 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
public class DoublyLinkedList {
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	ArrayList<Integer> list = new ArrayList<Integer>();
	for (int i = 0; i < n; i++) {
	    String[] input  = scan.nextLine().split(" ");
	    String command = input[0];
	    switch (command) {
	    case "insert":
		list.add(0, Integer.parseInt(input[1]));
		break;
	    case "delete":
		int index = list.indexOf(Integer.parseInt(input[1]));
		if(index != -1){
		    list.remove(index);
		}
		break;
	    case "deleteFirst":
		list.remove(0);
		break;
	    case "deleteLast":
		list.remove(list.size() - 1);
		break;
	    }
	}
	for (int i = 0; i < list.size() - 1; i++) {
	    System.out.print(list.get(i) + " ");
	}
	System.out.println(list.get(list.size() - 1));
    }
}

Compiler output:
Main.java:3: error: class DoublyLinkedList is public, should be declared in a file named DoublyLinkedList.java
public class DoublyLinkedList {
       ^
1 error
Language: Java

import java.io.*;
import java.util.ArrayList;
public class Main {
    public static void main(String[] args) throws IOException{
	BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(reader.readLine());
	ArrayList<Integer> list = new ArrayList<Integer>();
	String[] input;
	String commnad;
	for (int i = 0; i < n; i++) {
	    input  = reader.readLine().split(" ");
	    command = input[0];
	    switch (command) {
	    case "insert":
		list.add(0, Integer.parseInt(input[1]));
		break;
	    case "delete":
		int index = list.indexOf(Integer.parseInt(input[1]));
		if(index != -1){
		    list.remove(index);
		}
		break;
	    case "deleteFirst":
		list.remove(0);
		break;
	    case "deleteLast":
		list.remove(list.size() - 1);
		break;
	    }
	}
	for (int i = 0; i < list.size() - 1; i++) {
	    System.out.print(list.get(i) + " ");
	}
	System.out.println(list.get(list.size() - 1));
    }
}

Compiler output:
Main.java:12: error: cannot find symbol
	    command = input[0];
	    ^
  symbol:   variable command
  location: class Main
Main.java:13: error: cannot find symbol
	    switch (command) {
	            ^
  symbol:   variable command
  location: class Main
2 errors
Language: Java

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] commands;
		int num;
		LinkedList<Integer> list = new LinkedList<Integer>();
		for (int i = 0; i < n; i++) {
			commands = br.readLine().split(" ");
			if (commands[0].endsWith("First")) {
				list.removeFirst();
				continue;
			} else if (commands[0].endsWith("Last")) {
				list.removeLast();
				continue;
			}
			num = Integer.parseInt(commands[1]);
			if (commands[0].startsWith("i")) {
				list.addFirst(num);
			} else {
				list.remove(new Integer(num));
			}
		}
		Object[] output = list.toArray();

		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < output.length; i++) {
			if (i > 0) {
				sb.append(" ");
			}
			sb.append(output[i]);
		}
		System.out.println(sb.toString());
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:8: error: cannot find symbol
		LinkedList<Integer> list = new LinkedList<Integer>();
		^
  symbol:   class LinkedList
  location: class Main
Main.java:8: error: cannot find symbol
		LinkedList<Integer> list = new LinkedList<Integer>();
		                               ^
  symbol:   class LinkedList
  location: class Main
Main.java:22: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
				list.remove(new Integer(num));
				            ^
5 errors
1 warning
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
 
class Main {
 
    static ArrayDeque<String> queue = new ArrayDeque<String>();
 
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n; i++) {
            String order = br.readLine();
            if (order.contains("F")) {
                queue.poll();
            } else if (order.contains("L")) {
                queue.pollLast();
            } else if (order.contains("insert")) {
                queue.addFirst(order.replace("insert ", ""));
            } else {
                queue.removeFirstOccurrence(order.replace("delete ", ""));
            }
        }
 
        System.out.print(queue.poll());
        while (queue.isEmpty() != true) {
            System.out.print(" " + queue.poll());
        }
if(queue.isEmpty()){
System.out.println();
    }
}

Compiler output:
Main.java:33: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;

class Elem {
    Elem next;
    Elem prev;
    int key;
     
    Elem(int key) {
        this.key = key;
    }
}
 
class DoubleyLinkedList {
    Elem head;
     
    DoubleyLinkedList() {
        head = new Elem(-1);
        head.next = head;
        head.prev = head;
    }
     
    void insert(int key) {
        Elem e = new Elem(key);
        e.next = head.next;
        e.prev = head;
        e.next.prev = e;
        head.next = e;
    }
     
    void delete(int key) {
        for (Elem e = head.next; e != head; e = e.next) {
            if (e.key == key) {
                e.prev.next = e.next;
                e.next.prev = e.prev;
break;
            }
        }
    }
     
    void deleteFirst() {
        Elem e = head.next;
        e.next.prev = head;
        head.next = e.next;
    }
     
    void deleteLast() {
        Elem e = head.prev;
        e.prev.next = head;
        head.prev = e.prev;
    }
     
    public String toString() {
        StringBuilder sb = new StringBuilder();
        for (Elem e = head.next; e != head; e = e.next) {
            sb.append(e.key);
            sb.append(' ');
        }
        sb.deleteCharAt(sb.length() - 1);
        sb.append('\n');
        return sb.toString();
    }
}
 
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
        // BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
        int n = Integer.parseInt(br.readLine());
 
        DoubleyLinkedList list = new DoubleyLinkedList();
        for (int i = 0; i < n; i++) {
            String[] line = br.readLine().split(" ");
            if (line[0].equals("insert")) {
                list.insert(Integer.parseInt(line[1]));
            } else if (line[0].equals("delete")) {
                list.delete(Integer.parseInt(line[1]));
            } else if (line[0].equals("deleteFirst")) {
                list.deleteFirst();
            } else if (line[0].equals("deleteLast")) {
                list.deleteLast();
            }
        }
        System.out.print(list.toString());
    }
}

Compiler output:
Main.java:66: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:66: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                ^
  symbol:   class BufferedReader
  location: class Main
Main.java:66: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                   ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
import java.lang.Integer;
import java.lang.StringBuilder;
import java.lang.Math;

class Node {
  Node prev;
  Node next;
  int value;

  public Node(int x) {
    this.value = x;
  }
}

class LinkedList {
  Node head;
  Node tail;

  public LinkedList() {
    head = null;
    tail = null;
  }

  public void insert(int x) {
    Node n = new Node(x);
    if (head == null) {
      n.prev = null;
      n.next = null;
      head = n;
      tail = n;
      return;
    }

    n.next = head;
    n.prev = null;

    head.prev = n;
    head = n;
  }

  public boolean deleteFirst() {
    if (head == null) {
      return false;
    }

    if (head == tail) {
      head.prev = null;
      head.next = null;
      head = null;
      tail = null;
      return true;
    }

    // list contains 2 or more elements
    head = head.next;
    head.prev = null;
    return true;
  }

  public boolean deleteLast() {
    if (tail == null) {
      return false;
    }

    if (tail == head) {
      tail.prev = null;
      tail.next = null;
      head = null;
      tail = null;
      return true;
    }

    // list contains 2 or more elements
    tail = tail.prev;
    tail.next = null;
    return true;
  }

  public boolean delete(int x) {
    Node cursor = head;
    while (head != null) {
      if (cursor.value == x) {
        if (cursor == head) {
          return deleteFirst();
        } else if (cursor == tail) {
          return deleteLast();
        }
        cursor.prev.next = cursor.next;
        cursor.next.prev = cursor.prev;
        return true;
      }
    }
    return false;
  }

  public void print() {
    StringBuilder buf = new StringBuilder();
    Node cursor = head;
    while (cursor != null) {
      buf.append(cursor.value);
      buf.append(" ");
      cursor = cursor.next;
    }
    System.out.println(buf.toString().trim());
  }


}

public class Main {
  private static int N;

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    LinkedList list = new LinkedList();

    for (int i = 0; i < N; i++) {
      String cmd = in.next();
      switch(cmd) {
        case "insert":
          list.insert(in.nextInt());
          break;
        case "delete":
          list.delete(in.nextInt());
          break;
        case "deleteFirst":
          list.deleteFirst();
          break;
        case "deleteLast":
          list.deleteLast();
          break;
        default:
          System.out.println("Error");
          System.exit(1);
      }
    }
    list.print();
  }
}
oz

Compiler output:
Main.java:142: error: reached end of file while parsing
oz
^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        LinkedList<Integer> list = new LinkedList<Integer>;
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        for(int i=0; i<n; i++)
        {
            String command = scan.nextString();
            int num = scan.nextInt();
            switch(command)
            {
                case "insert":
                    list.add(num);
                    break;
                case "delete":
                    list.remove(list.indexOf(num));
                    break;
                case "deleteFirst":
                    list.removeFirst();
                    break;
                case "deleteLast":
                    list.removeFirst();
                    break;
                default:
                    break;
            }
        }
        for(int i=0; i<list.size(); i++)
        {
            System.out.printf("%d",list.get(i));
            if(i!=lit.size()-1)
            {
                System.out.printf(" ");
            }
        }
    }
}

Compiler output:
Main.java:8: error: '(' or '[' expected
        LinkedList<Integer> list = new LinkedList<Integer>;
                                                          ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        LinkedList<Integer> list = new LinkedList<Integer>();
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        for(int i=0; i<n; i++)
        {
            String command = scan.nextString();
            int num = scan.nextInt();
            switch(command)
            {
                case "insert":
                    list.add(num);
                    break;
                case "delete":
                    list.remove(list.indexOf(num));
                    break;
                case "deleteFirst":
                    list.removeFirst();
                    break;
                case "deleteLast":
                    list.removeFirst();
                    break;
                default:
                    break;
            }
        }
        for(int i=0; i<list.size(); i++)
        {
            System.out.printf("%d",list.get(i));
            if(i!=lit.size()-1)
            {
                System.out.printf(" ");
            }
        }
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
            String command = scan.nextString();
                                 ^
  symbol:   method nextString()
  location: variable scan of type Scanner
Main.java:37: error: cannot find symbol
            if(i!=lit.size()-1)
                  ^
  symbol:   variable lit
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        LinkedList<Integer> list = new LinkedList<Integer>();
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        for(int i=0; i<n; i++)
        {
            String command = scan.next();

            switch(command)
            {
                case "insert":
                    list.add(scan.nextInt();;
                    break;
                case "delete":
                    list.remove(list.indexOf(scan.nextInt()));
                    break;
                case "deleteFirst":
                    list.removeFirst();
                    break;
                case "deleteLast":
                    list.removeFirst();
                    break;
                default:
                    break;
            }
        }
        for(int i=0; i<list.size(); i++)
        {
            System.out.printf("%d",list.get(list.size()-i-1));
            if(i!=list.size()-1)
            {
                System.out.printf(" ");
            }
        }
    }
}

Compiler output:
Main.java:19: error: ')' or ',' expected
                    list.add(scan.nextInt();;
                                           ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        LinkedList<Integer> list = new LinkedList<Integer>();
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int memory[] = new int[1000000000];
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command)
            {
                case "insert":
                    num=scan.nextInt();
                    list.addFirst(num);
                    memory[num]++;
                    break;
                case "delete":
                    int num=scan.nextInt();
                    if(memory[num]>0)
                    {
                        list.remove(list.indexOf(num));
                    }
                    break;
                case "deleteFirst":
                    memory[list.getFirst()]--;
                    list.removeFirst();
                    break;
                case "deleteLast":
                    memory[list.getLast()]--;
                    list.removeLast();
                    break;
                default:
                    break;
            }
        }
        for(int i=0; i<list.size(); i++)
        {
            System.out.printf("%d",list.get(i));
            if(i<list.size()-1)
            {
                System.out.printf(" ");
            }
        }
        System.out.println();
    }
}

Compiler output:
Main.java:24: error: variable num is already defined in method main(String[])
                    int num=scan.nextInt();
                        ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        LinkedList<Integer> list = new LinkedList<Integer>();
        Scanner scan = new Scanner(System.in);
        int hash = 2000000;
        int n = scan.nextInt();
        int memory[] = new int[hash];
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command)
            {
                case "insert":
                    num=scan.nextInt();
                    memory[num%hash]++;
                    list.offerFirst(num);
                    break;
                case "delete":
                    num=scan.nextInt();
                    if(memory[num%hash]>0)
                    {
                        list.remove((Integer)num;
                        memory[num%hash]--;
                    }*/
                    break;
                case "deleteFirst":
                    memory[list.getFirst()%hash]--;
                    list.pollFirst();
                    break;
                case "deleteLast":
                    memory[list.getLast()%hash]--;
                    list.pollLast();
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:28: error: ')' or ',' expected
                        list.remove((Integer)num;
                                                ^
Main.java:30: error: illegal start of expression
                    }*/
                     ^
Main.java:30: error: illegal start of expression
                    }*/
                      ^
Main.java:31: error: illegal start of expression
                    break;
                    ^
4 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        LinkedList<Integer> list = new LinkedList<Integer>();
        Scanner scan = new Scanner(System.in);
        int hash = 2000000;
        int n = scan.nextInt();
        int memory[] = new int[hash];
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command)
            {
                case "insert":
                    num=scan.nextInt();
                    memory[num%hash]++;
                    list.offerFirst(num);
                    break;
                case "delete":
                    num=scan.nextInt();
                    if(memory[num%hash]>0)
                    {
                        list.remove((Integer)num;
                        memory[num%hash]--;
                    }
                    break;
                case "deleteFirst":
                    memory[list.getFirst()%hash]--;
                    list.pollFirst();
                    break;
                case "deleteLast":
                    memory[list.getLast()%hash]--;
                    list.pollLast();
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:28: error: ')' or ',' expected
                        list.remove((Integer)num;
                                                ^
1 error
Language: Java


import java.util.ArrayDeque;
import java.util.Scanner;

public class Main {
	
	public static void main(String [] args){
		
		ArrayDeque<Integer> list = new ArrayDeque<Integer>();
		Scanner scanner = new Scanner(System.in);
		int n = Integer.parseInt(scanner.nextLine());
		String  str;
		
		for(int i=0; i<n; i++){
			str = scanner.nextLine();
			if(str.charAt(0) == 'i'){
				list.addFirst(Integer.parseInt(str.substring(7)));
			}else if(str.charAt(6) == ' '){
				list.remove((Integer) Integer.parseInt(str.substring(7)));
			}else if(str.charAt(6) == 'f''){
				list.removeFirst();
			}else{
				list.removeLast();
			}	
		}
		
		System.out.print(list.pop());
		while(!list.isEmpty() ){
			System.out.print(" "+list.pop());
		}
		System.out.println();
 		scanner.close();
 		
	}
  
}

Compiler output:
Main.java:20: error: unclosed character literal
			}else if(str.charAt(6) == 'f''){
			                             ^
Main.java:22: error: 'else' without 'if'
			}else{
			 ^
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
//        LinkedList<Integer> list = new LinkedList<Integer>();
        Scanner scan = new Scanner(System.in);
//        int hash = 20000000;
        int n = scan.nextInt();
//        int memory[] = new int[hash];
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command)
            {
                case "insert":
//                    num=scan.nextInt();
//                    memory[num%hash]++;
//                    list.offerFirst(num);
                    list.offerFirst(scan.nextInt());
                    break;
                case "delete":
/*                    num=scan.nextInt();
                    if(memory[num%hash]>0)
                    {
                        list.remove((Integer)num);
                        memory[num%hash]--;
                    }*/
                    list.remove((integer)scan.nextInt());
                    break;
                case "deleteFirst":
//                    memory[list.getFirst()%hash]--;
                    list.pollFirst();
                    break;
                case "deleteLast":
//                    memory[list.getLast()%hash]--;
                    list.pollLast();
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:33: error: cannot find symbol
                    list.remove((integer)scan.nextInt());
                                 ^
  symbol:   class integer
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command.chatAt(1))
            {
                case 'i':
                    list.offerFirst(scan.nextInt());
                    break;
                case 'd'
                    switch(command.chatAt(6))
                    {
                        case 'F':
                            list.pollFirst();
                            break;
                        case 'L':
                            list.pollLast();
                            break;
                        default:
                            list.remove((Integer)scan.nextInt());
                            break;
                    }
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:20: error: : or -> expected
                case 'd'
                        ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command.chatAt(1))
            {
                case 'i':
                    list.offerFirst(scan.nextInt());
                    break;
                case 'd':
                    switch(command.chatAt(6))
                    {
                        case 'F':
                            list.pollFirst();
                            break;
                        case 'L':
                            list.pollLast();
                            break;
                        default:
                            list.remove((Integer)scan.nextInt());
                            break;
                    }
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:15: error: cannot find symbol
            switch(command.chatAt(1))
                          ^
  symbol:   method chatAt(int)
  location: variable command of type String
Main.java:21: error: cannot find symbol
                    switch(command.chatAt(6))
                                  ^
  symbol:   method chatAt(int)
  location: variable command of type String
2 errors
Language: Java

import java.io.*;
import java.util.*;
public class Main
{
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = scan.next();
            switch(command.charAt(0))
            {
                case 'i':
                    list.offerFirst(scan.nextInt());
                    break;
                case 'd':
                    if(command.size()>=6)
                    {
                        switch(command.charAt(6))
                        {
                            case 'F':
                                list.pollFirst();
                                break;
                            case 'L':
                                list.pollLast();
                                break;
                            default:
                                break;
                        }
                    }
                    else
                    {
                        list.remove((Integer)scan.nextInt());
                    }
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:20: error: cannot find symbol
                    if(command.size()>=6)
                              ^
  symbol:   method size()
  location: variable command of type String
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        BufferedReader br = new BufferedReader(System.in);
//        Scanner scan = new Scanner(System.in);
//        int n = scan.nextInt();
        int n = br.readLine();
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = br.readLine();
//            String command = scan.next();
            switch(command.charAt(0))
            {
                case 'i':
                    list.offerFirst(scan.nextInt());
                    break;
                case 'd':
                    if(command.length()>6)
                    {
                        switch(command.charAt(6))
                        {
                            case 'F':
                                list.pollFirst();
                                break;
                            case 'L':
                                list.pollLast();
                                break;
                            default:
                                break;
                        }
                    }
                    else
                    {
                        list.remove((Integer)string.charAt(7));
                    }
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:8: error: incompatible types: InputStream cannot be converted to Reader
        BufferedReader br = new BufferedReader(System.in);
                                                     ^
Main.java:11: error: incompatible types: String cannot be converted to int
        int n = br.readLine();
                           ^
Main.java:21: error: cannot find symbol
                    list.offerFirst(scan.nextInt());
                                    ^
  symbol:   variable scan
  location: class Main
Main.java:40: error: cannot find symbol
                        list.remove((Integer)string.charAt(7));
                                             ^
  symbol:   variable string
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        BufferedReader br = new BufferedReader(System.in);
//        Scanner scan = new Scanner(System.in);
//        int n = scan.nextInt();
        int n = Integer.parseInt(br.readLine());
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = br.readLine();
//            String command = scan.next();
            switch(command.charAt(0))
            {
                case 'i':
                    list.offerFirst(Integer.parseInt(command.charAt(7)));
                    break;
                case 'd':
                    if(command.length()>6)
                    {
                        switch(command.charAt(6))
                        {
                            case 'F':
                                list.pollFirst();
                                break;
                            case 'L':
                                list.pollLast();
                                break;
                            default:
                                break;
                        }
                    }
                    else
                    {
                        list.remove((Integer)string.charAt(7));
                    }
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:8: error: incompatible types: InputStream cannot be converted to Reader
        BufferedReader br = new BufferedReader(System.in);
                                                     ^
Main.java:21: error: incompatible types: char cannot be converted to String
                    list.offerFirst(Integer.parseInt(command.charAt(7)));
                                                                   ^
Main.java:40: error: cannot find symbol
                        list.remove((Integer)string.charAt(7));
                                             ^
  symbol:   variable string
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
//        Scanner scan = new Scanner(System.in);
//        int n = scan.nextInt();
        int n = Integer.parseInt(br.readLine());
        Deque<Integer> list = new ArrayDeque<Integer>();
        int num;
        for(int i=0; i<n; i++)
        {
            String command = br.readLine();
//            String command = scan.next();
            switch(command.charAt(0))
            {
                case 'i':
                    list.offerFirst(Integer.parseInt("" + command.charAt(7)));
                    break;
                case 'd':
                    if(command.length()>6)
                    {
                        switch(command.charAt(6))
                        {
                            case 'F':
                                list.pollFirst();
                                break;
                            case 'L':
                                list.pollLast();
                                break;
                            default:
                                break;
                        }
                    }
                    else
                    {   num = Integer.parseInt("" + command.charAt(7));
                        list.remove((Integer)num);
                    }
                    break;
                default:
                    break;
            }
        }
        while(list.size()>1)
        {
            System.out.printf("%d ",list.poll());
        }
        System.out.println(list.poll());
    }
}

Compiler output:
Main.java:12: error: unreported exception IOException; must be caught or declared to be thrown
        int n = Integer.parseInt(br.readLine());
                                            ^
Main.java:17: error: unreported exception IOException; must be caught or declared to be thrown
            String command = br.readLine();
                                        ^
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        try{
            int i;
            int n = Integer.parseInt(br.readLine());
            Deque<Integer> list = new ArrayDeque<Integer>();
            int[] num = new int[2];
            char c;
            for(i=0; i<n; i++)
            {
                String command = br.readLine();
                c = command.charAt(0);
                if(c == 'i')
                {
                    num = Integer.parseInt(command.split(" ",0));
                    list.offerFirst(num[1]);
                }
                else if(c == 'd')
                {
                    c = command.charAt(6);
                    if(c == 'F')
                    {
                        list.pollFirst();
                    }
                    else if(c == 'L')
                    {
                        list.pollLast();
                    }
                    else
                    {
                        num = Integer.parseInt(command.split(" ",0));
                        list.remove((Integer)num[1]);
                    }
                }
            }
            int size = list.size();
            for(i=0; i<size-1; i++)
            {
                System.out.printf("%d ",list.poll());
            }
            System.out.println(list.poll());
        }
        catch(Exception e)
        {
        }
    }
}

Compiler output:
Main.java:22: error: incompatible types: String[] cannot be converted to String
                    num = Integer.parseInt(command.split(" ",0));
                                                        ^
Main.java:38: error: incompatible types: String[] cannot be converted to String
                        num = Integer.parseInt(command.split(" ",0));
                                                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors