@@ -0,0 +1,543 @@
+// https://community.topcoder.com/stat?c=problem_statement&pm=11307%0A%0Apublic class CarrotBoxesEasy %7B%0A%09public static int theIndex(int%5B%5D carrots, int K) %7B%0A%09%09int lastIndex = 0;%0A%09%09%0A%09%09while (K != 0) %7B%0A%09%09%09// Get max carrots element & remember index of that element%0A%09%09%09int maxCarrots = 0;%0A%09%09%09for (int i = 0; i %3C carrots.length; ++i) %7B%0A%09%09%09%09if (carrots%5Bi%5D %3E maxCarrots) %7B%0A%09%09%09%09%09maxCarrots = carrots%5Bi%5D;%0A%09%09%09%09%09lastIndex = i;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09// Remove a carrot from the max carrots element%0A%09%09%09carrots%5BlastIndex%5D--;%0A%09%09%09%0A%09%09%09K--;%0A%09%09%7D%0A%09%09%0A%09%09return lastIndex;%0A%09%7D%0A%7D%0A

Create CarrotBoxesEasy.java