I have made this program for finding the Longest progressive sequence. Though it runs but I am getting the following compile time error: Sequence.java uses unchecked or unsa
TreeSet is a generic Class. You need to give it a type. It looks like you're adding ints into it, so the correct declaration would be
ints
TreeSet<Integer> ans = new TreeSet<>();
or, in pre Java7 versions,
TreeSet<Integer> ans = new TreeSet<Integer>();