Given an array A of size N, you need to find its maximum, 2nd maximum, and 3rd maximum element.
Try solving it in O(N) per test case

**Input**

The first line of the input contains the number of test cases T.

For each test case, the first line of the input contains an integer N denoting the number of elements in the array A. The next line contains N (space separated) elements of A.

```
Constraints:
1 <= T <= 100
3 <= N <= 10^6
1 <= A[i] <= 10^9

```

***In my code, every test case is passing except one which is showing MLE.***

```
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework

// don't change the name of this class
// you can add inner classes if needed
class Main {
    public static void main (String[] args) {
                      // Your code here
                      Scanner sc = new Scanner(System.in);
                      int size = sc.nextInt();

                        while(size>0){
                           int n = sc.nextInt();
                          int myarray[] = new int [n];
                          for(int j=0; j<n;j++) {
                          myarray[j]= sc.nextInt();
                      }
                      printNumber(myarray);
                      size--;
                        }                
    }
    public static void printNumber(int [] myarray){
        int first=0;
        int second=0;
        int third=0;

        for(int i=0;i<myarray.length;i++){

            if (myarray[i] > first){
               third=second;
               second=first;
               first=myarray[i];
      }
      else if (myarray[i] > second){
         third = second;
         second = myarray[i];
      }
      else if (myarray[i] > third)
         third = myarray[i];
   }
   System.out.println(first+" "+second+" "+third);
        }
    }

```