package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/non-divisible-subset
 */
public class NonDivisibleSubset {
    private static int nonDivisibleSubset(int[] array, int k) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = in.nextInt();
        }
        System.out.println(nonDivisibleSubset(array, k));
    }
}

@@ -221,15 +221,284 @@
     
-// TODO
+int%5B%5D mods = new int%5Barray.length%5D;%0A        for (int i = 0; i %3C array.length; i++) %7B%0A            mods%5Barray%5Bi%5D %25 k%5D++;%0A        %7D%0A        int max = mods%5B0%5D;%0A        for (int i = 1, j = mods.length - 1; i %3C j; i++, j--) %7B%0A            max += Math.max(mods%5Bi%5D, mods%5Bj%5D);%0A        %7D
 %0A   
@@ -509,17 +509,19 @@
  return 
-0
+max
 ;%0A    %7D%0A

Update Non-Divisible Subset