Merge Sort problem

Whats wrong in this code ??
package Lecture1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;

public class RecursionChallenge {

public static void main(String[] args) {
	// TODO Auto-generated method stub

	Scanner s = new Scanner(System.in);
	int n=s.nextInt();
	int []a= new int[n];
	for(int i=0;i<n;i++)
	a[i]=s.nextInt();
	int []sorted=mergesort(a, 0,a.length-1);
	for(int i=0;i<a.length;i++)
	System.out.print(sorted[i]+" ");
	System.out.println();
}

public static int[] mergesort(int []a,int low,int high)
{
if(low==high)
{
int []myarray= new int[1];
myarray[0]=a[low];
return myarray;
}

   int mid=(low+high)/2;
   int []array1= mergesort(a, low, mid);
   int []array2 = mergesort(a, mid+1, high);
   
   return merge(array1,array2);

}

public static int [] merge(int []array1,int []array2)
{
int []res= new int[array1.length+array2.length];
int i=0,j=0,k=0;
while(i<array1.length&&j<array2.length)
{
if(array1[i]<=array2[j])
{
res[k++]=array1[i];
i++;
}
else if(array1[i]>array2[j])
{
res[k++]=array2[j];
j++;
}

   }
   
   while(i<array1.length)
   {
		res[k++]=array1[i];		
		i++;

   }
   
   while(j<array2.length)
   {
		res[k++]=array2[j];		
        j++;

   }

   
   return res;

}
}

Your code is perfect and is passing all test cases on hackerblocks. What problem are you facing?

Its not showing output!

Did you provide input in the input box? It was showing output when I ran it. Is it showing any error message? If yes, please share that.

It is showning o/p when i press run button while when i submit the code it showing nothing

It does not display output when you submit your code. It only shows how many test cases have passed/failed.