driver code to check the above function
public static void main ( String [ ] args ) { int [ ] a = { 1 , 3 , 6 , 13 , 17 , 18 } ; int n = a . length ; System . out . println ( largestSubset ( a , n ) ) ; } }