@@ -0,0 +1,482 @@
+package week_of_code_30;%0A%0Aimport java.util.Scanner;%0A%0Apublic class CandyReplenishingRobot %7B%0A  public static void main(String%5B%5D args) %7B%0A    Scanner in = new Scanner(System.in);%0A    int n = in.nextInt();%0A    int originalN = n;%0A    int t = in.nextInt();%0A    int count = 0;%0A%0A    while (t-- %3E 1) %7B%0A      int b = in.nextInt();%0A      n -= b;%0A      if (n %3C 5) %7B%0A        count += (originalN - n);%0A        n = originalN;%0A      %7D%0A    %7D%0A    %0A    System.out.println(count);%0A    in.close();%0A  %7D%0A%7D%0A

Add hackerrank week of code 30 solution