For this Question: An array of integers of size N is given to you. You have to print the third- highest integer in the array in linear time.

<b>Note:</b>
The third highest element of the array is the third number in the array when sorted in non- increasing order.

<b>Example</b>
An array is given: 2 4 6 12 1 
The third highest number is 4, Hence the output will be 4.A single integer n.
The next line contains n integers separated by space.

<b>Constraints </b>
3 &le; n &le; 10<sup>5</sup>
-10<sup>9</sup> &le; arr[i] &le; 10<sup>9</sup>A single integer denotes the required answer.Sample Input:
6
-2 7 3 1 6 5

Sample Output:
5

Explanation :
sort in non- increasing order : 7 6 5 3 1 -2, I have written this Solution Code: import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {       
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        int n=Integer.parseInt(in.next());       
        int a[] = new int[n];
        for(int i=0;i<n;i++){
            a[i]=Integer.parseInt(in.next());
        }
        int x=-1,y=-1,z=-1;
        for(int i=0;i<n;i++){
           if(x==-1 || a[i] >= a[x]){
               z=y;
               y=x;
               x=i;
           }
           else if(y==-1 || a[i] >= a[y]){
               z=y;
               y=i;
           }
           else if(z == -1 || a[i] >= a[z]){
               z=i;
           }
        }
        out.print(a[z]);
        out.close();
    }
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?