Two test case passed but 1 test case fail can you please tell me what is wrong with my code
import java.util.*;
public class Main {
public static int partition(int arr[],int low,int high){
int temp,s,j;
int i=low-1;
int p=arr[high];
for(j=low;j<high;j++){
if(arr[j]<p){
i++;
temp=arr[j];
arr[j]=arr[i];
arr[i]=temp;
}
}
s= arr[i+1];
arr[i+1]=arr[high];
arr[high]=s;
return i+1;
}
public static void sort(int arr[],int low,int high){
if(low<high){
int pi=partition(arr,low,high);
sort(arr,low,pi-1);
sort(arr,pi+1,high);
}
}
public static void arrays(int arr[],int n){
for(int i=0;i<n;i++){
System.out.print(arr[i]+" ");
}}
public static void main(String args[]) {
try{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int arr[] =new int[n];
System.out.println();
for(int h=0;h<n;h++)
arr[h]=sc.nextInt();
Main ob = new Main();
ob.sort(arr, 0, n-1);
System.out.println();
arrays(arr,n);
}catch(Exception e){System.out.println(e);}
}
}