@@ -0,0 +1,816 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        int%5B%5D a = new int%5Bn%5D;%0A        for(int a_i=0; a_i %3C n; a_i++)%7B%0A            a%5Ba_i%5D = in.nextInt();%0A        %7D%0A        int x = getMaxSet(a, n);%0A        System.out.println(x);%0A    %7D%0A    %0A    static int getMaxSet(int arr%5B%5D, int n)%7B%0A        Arrays.sort(arr);%0A        int cnt =0;%0A        int max=0;%0A        for(int i=0;i%3Cn;i++)%7B%0A            for(int j=i;j%3Cn;j++)%7B%0A                if(arr%5Bj%5D-arr%5Bi%5D%3C=1)%7B%0A                    cnt++;%0A                %7D%0A            %7D%0A            if(cnt%3Emax)%0A                max=cnt;%0A            cnt=0;%0A        %7D%0A        return max;%0A    %7D%0A%7D%0A

add PickingNumbers.java