@@ -0,0 +1,1521 @@
+import java.util.*;%0Aimport java.util.stream.Collectors;%0Aimport java.util.stream.IntStream;%0A%0Aimport static org.junit.Assert.assertArrayEquals;%0A%0A/**%0A * Created by jeremy on 03/13/2019.%0A */%0Apublic class Programmers %7B%0A    public static int%5B%5D solution(int%5B%5D progresses, int%5B%5D speeds) %7B%0A        List%3CInteger%3E deploys = new ArrayList%3C%3E();%0A        Queue%3CInteger%3E works = IntStream.range(0, progresses.length).boxed().collect(Collectors.toCollection(LinkedList::new));%0A%0A        while (!works.isEmpty()) %7B%0A            int done = 0;%0A            // 1. check if work is done%0A            for (int i = 0; i %3C progresses.length; i++) %7B%0A                int progress = progresses%5Bi%5D;%0A                if (works.element() == i && progress %3E= 100) %7B%0A                    done++;%0A                    works.remove();%0A                %7D%0A            %7D%0A            if (done %3E 0) deploys.add(done);%0A%0A            // 2. work%0A            for (int i = 0; i %3C progresses.length; i++) %7B%0A                if (progresses%5Bi%5D %3C 100) %7B%0A//                    print(progresses);%0A                    progresses%5Bi%5D += speeds%5Bi%5D;%0A                %7D%0A            %7D%0A        %7D%0A%0A        return deploys.stream().mapToInt(i -%3E i).toArray();%0A    %7D%0A%0A    public static void print(int%5B%5D progresses) %7B%0A        Arrays.stream(progresses).boxed().forEach(p -%3E System.out.print(p + %22 %22));%0A        System.out.println();%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        assertArrayEquals(new int %5B%5D %7B 2, 1 %7D, solution(new int %5B%5D %7B 93,30,55 %7D, new int%5B%5D %7B 1,30,5 %7D));%0A    %7D%0A%7D%0A

add Programmers