/* Given an array of positive integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can be in any order. */ /* Time Complexity: O(n) Space Complexity: O(n) */ import java.math.*; import java.util.*; import java.io.*; class Driverclass { static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){ br = new BufferedReader(new InputStreamReader(System.in)); } String next(){ while (st == null || !st.hasMoreElements()){ try{ st = new StringTokenizer(br.readLine()); } catch (IOException e){ e.printStackTrace(); } } return st.nextToken(); } String nextLine(){ String str = ""; try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } Integer nextInt(){ return Integer.parseInt(next()); } } public static void main(String args[]) { FastReader sc = new FastReader(); PrintWriter out = new PrintWriter(System.out); int t = sc.nextInt(); while(t>0) { int n = sc.nextInt(); int a[] = new int[n]; for(int i=0; i set = new HashSet<>(); int ans=0; for(int num: arr) set.add(num); for(int i=0; i