So, I used a quick sort to implement the problem in Java. It works fine for the given input set but gives wrong answer. Can someone help me please???

```
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
public class Main {
public static int partition(int arr[], int left, int right){
int pivot=arr[(left+right)/2];
int i=left;
int j=right;
int temp;
while(i<=j){
while(arr[i]<pivot)i++;
while(arr[j]>pivot)j--;
if(i<=j){
temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
i++;
j--;}}
return i;}
public static void QuickSort(int arr[], int left, int right){
int index=partition(arr,left,right);
if(left<index-1)QuickSort(arr,left,index-1);
if(index<right)QuickSort(arr,index,right);}
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintStream ps = new PrintStream(System.out);
StringBuilder sb = new StringBuilder("");
int t=Integer.parseInt(f.readLine());
int [] turbo=new int[t];
for(int i=0;i<t;i++)turbo[i]=Integer.parseInt(f.readLine());
QuickSort(turbo,0,t-1);
for(int i=0;i<t;i++){
if(i==t-1)sb.append(turbo[i]).append("\n");
else{
if(turbo[i]!=turbo[i+1])
sb.append(turbo[i]).append("\n");}}
ps.println(sb);}
}
```