My issue
find error in this solution.
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i = 0; i < t; i++){
int n = sc.nextInt();
int arrival[] = new int[n];
int departure[] = new int[n];
for(int j = 0; j < n; j++){
arrival[j] = sc.nextInt();
}
for(int k = 0; k < n; k++){
departure[k] = sc.nextInt();
}
Arrays.sort(arrival);
Arrays.sort(departure);
int cnt = n;
for(int l = 0; l < n; l++){
if(departure[l] <= arrival[l]){
cnt--;
}
}
System.out.println(cnt);
}
}
}
Problem Link: Hotel Bytelandia Practice Coding Problem