package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/cut-the-sticks
 */
public class CutTheSticks {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
    }
}

@@ -14,16 +14,126 @@
 rrank;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A
 import j
@@ -333,16 +333,722 @@
 em.in);%0A
+        int n = in.nextInt();%0A        List%3CInteger%3E l = new ArrayList%3C%3E();%0A        for (int i = 0; i %3C n; i++) %7B%0A            l.add(in.nextInt());%0A        %7D%0A        Collections.sort(l);%0A        LinkedList%3CInteger%3E ll = new LinkedList%3C%3E(l);%0A        System.out.println(ll.size());%0A        while (ll.size() %3E 0) %7B%0A            int min = ll.getFirst();%0A            int size = ll.size();%0A            for (int i = 0; i %3C size; i++) %7B%0A                int e = ll.getFirst();%0A                int val = e - min;%0A                if (val == 0) %7B%0A                    ll.removeFirst();%0A                %7D%0A            %7D%0A            if (ll.size() %3E 0) %7B%0A                System.out.println(ll.size());%0A            %7D%0A        %7D%0A
     %7D%0A%7D%0A

Solve Cut the Sticks problem