@@ -0,0 +1,585 @@
+// https://community.topcoder.com/stat?c=problem_statement&pm=11631%0A%0Aimport java.util.Arrays;%0A%0Apublic class DengklekTryingToSleep %7B%0A%09public static int minDucks(int%5B%5D ducks) %7B%0A%09%09if (ducks.length %3C= 1) %7B%0A%09%09%09return 0;%0A%09%09%7D%0A%09%09%0A%09%09Arrays.sort(ducks);%0A%09%09%0A%09%09int numberOfMissedDucks = 0;%0A%09%09for (int A = ducks%5B0%5D, B = ducks%5Bducks.length-1%5D; A %3C= B; ++A) %7B%0A%09%09%09boolean duckFound = false;%0A%09%09%09for (int i = 0; i %3C ducks.length; ++i) %7B%0A%09%09%09%09if (ducks%5Bi%5D == A) %7B%0A%09%09%09%09%09duckFound = true;%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09if (!duckFound) %7B%0A%09%09%09%09numberOfMissedDucks++;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09return numberOfMissedDucks;%0A%09%7D%0A%7D%0A

Create DengklekTryingToSleep.java