@@ -0,0 +1,1443 @@
+package algorithm.implementation;%0D%0A%0D%0Aimport java.util.Collections;%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @version $Revision$%0D%0A * @version $Date$%0D%0A * @author $Author$%0D%0A * @owner Sandro Mario Zbinden%0D%0A */%0D%0Apublic class CutTheSticks %7B%0D%0A    public static class Solution %7B%0D%0A%0D%0A        public static void cutTheSticks(Map%3CInteger, Integer%3E stickMap) %7B%0D%0A            if (stickMap.isEmpty()) %7B%0D%0A                return;%0D%0A            %7D else %7B%0D%0A                System.out.println(stickMap.values().stream().mapToInt(Integer::intValue).sum());%0D%0A                stickMap.remove(Collections.min(stickMap.keySet()));%0D%0A                cutTheSticks(stickMap);%0D%0A            %7D%0D%0A%0D%0A        %7D%0D%0A%0D%0A        public static void main(String%5B%5D args) %7B%0D%0A            try (Scanner in = new Scanner(System.in)) %7B%0D%0A                int n = in.nextInt();%0D%0A                Map%3CInteger, Integer%3E stickMap = new HashMap%3C%3E();%0D%0A                for (int i = 0; i %3C n; i++) %7B%0D%0A                    int stick = in.nextInt();%0D%0A                    if (stickMap.containsKey(stick)) %7B%0D%0A                        stickMap.put(stick, stickMap.get(stick) + 1);%0D%0A                    %7D else %7B%0D%0A                        stickMap.put(stick, 1);%0D%0A                    %7D%0D%0A                %7D%0D%0A                cutTheSticks(stickMap);%0D%0A            %7D%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        Solution.main(null);%0D%0A    %7D%0D%0A%7D%0D%0A

Add solution for CutTheSticks Problem