@@ -0,0 +1,523 @@
+// https://community.topcoder.com/stat?c=problem_statement&pm=6558%0A%0Apublic class EscapeFromRectangle %7B%0A%09public static int shortest(int x, int y, int w, int h) %7B%0A%09%09// distance to reach point 0 on X-coordinate = value of 'x'%0A%09%09// distance to reach point 0 on Y-coordinate = value of 'y'%0A%09%09// distance to reach point w on X-coordinate = value of 'w-x'%0A%09%09// distance to reach point h on Y-coordinate = value of 'h-y'%0A%09%09// We need the minimum from these distances%0A%09%09return Math.min(Math.min(x, y), Math.min((w-x), (h-y)));%0A%09%7D%0A%7D%0A

Create EscapeFromRectangle.java