Condition if the number of distinct elements is greater than k
if ( mp . size ( ) > k ) { System . out . print ( "Not possibleNEW_LINE"); return ; } Vector < Integer > ans = new Vector < Integer > ( ) ;