(JAVA-TA) -> NoSuchElementException

i am facing this exception , m not getting how to resolve it,.

@87adarsh.gupta please send code here , will check it.

import java.util.Scanner; public class Main { public static int maxSubsequence(String[] arr){ return maxSubsequence(arr,0,""); } private static int maxSubsequence(String[] arr, int start,String subs){ if(start == arr.length){ boolean flag = checkUnique(subs); if(flag) return subs.length(); else return Integer.MIN_VALUE; }//Base Case int max1 = maxSubsequence(arr,start+1,subs+arr[start]); int max2 = maxSubsequence(arr,start+1,subs); return (Math.max(max1,max2)); }//End of maxSubsequence() Method private static boolean checkUnique(String subs){ if(subs.length() == 0 || subs.length() == 1) return true; int[] cache = new int[26]; for(int i=0;i<26;i++) cache[subs.charAt(i) - ‘a’]++; for(int i=0;i<26;i++) if(cache[i] > 1) return false; return true; } public static void main (String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] arr = new String[n]; for(int i=0;i<n;i++) arr[i] = sc.nextLine(); sc.close(); int res = maxSubsequence(arr); System.out.println(res); } }

plx resolve the issue its been days , m stuck in this

@87adarsh.gupta hey please send your code on coding blocks ide and share link.