> 
> Given an array of integers, find out the third largest value in the array.
> 
> 
> 

**MyApproach**

Sample Input #1
===============

remove({1,2,3,4,5,0,1,2,0,0,2})

Sample Output #1

{1,2,3,4,5,1,2,2}

Sample Input #2
===============

remove({0,0,1,2})

Sample Output #2

{1,2}

Sample Input #3
===============

remove({0,0,0,0})

Sample Output #3

{}

**MyApproach**

@Edit

To find maximum number I sorted the array and returned the maximum number.

Below is my code.

Thank you everyone for your support.

Below is my code:

```
public int thirdLargest(int[] arr)
{
 for(int i=0;i<arr.length;i++)
 {
   int temp=0;
   int large=0;
   int index=0;

       large=arr[i];
       for(int j=i;j<arr.length;j++)
       {
           if(arr[j]>=large)
           {
               large=arr[j];
               index=j;
            }
        }
       temp=arr[i];
       arr[i]=arr[index];
       arr[index]=temp;
 }
 return arr[2];
}

```