@@ -0,0 +1,1230 @@
+/* %0AIn the Quicksort challenges, you sorted an entire array. Sometimes, you just need specific information about a list of numbers, and doing a full sort would be unnecessary. Can you figure out a way to use your partition code to find the median in an array?%0A%0AChallenge%0AGiven a list of numbers, can you find the median?%0A%0AInput Format%0AThere will be two lines of input:%0A%0A    n - the size of the array%0A    ar - n numbers that makes up the array%0A%0AOutput Format%0AOutput one integer, the median.%0A%0AConstraints%0A1%3C= n %3C= 1000001%0A-10000 %3C= x %3C= 10000 , x %E2%88%88 ar%0AThere will be an odd number of elements.%0A%0ASample Input%0A%0A7%0A0 1 2 4 6 5 3%0A%0ASample Output%0A%0A3%0A */%0A%0Apackage com.hackerrank;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Scanner;%0A%0Apublic class FindTheMedian %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner in = new Scanner(System.in);%0A%09%09int n = in.nextInt();%0A%0A%09%09if (isInRange(1, 1000001, n)) %7B%0A%09%09%09int%5B%5D an = new int%5Bn%5D;%0A%09%09%09for (int i = 0; i %3C n; i++) %7B%0A%09%09%09%09int tmp = in.nextInt();%0A%09%09%09%09if (isInRange(-10000, 10000, tmp)) %7B%0A%09%09%09%09%09an%5Bi%5D = tmp;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09Arrays.sort(an);%0A%09%09%09System.out.println(an%5Bn / 2%5D);%0A%09%09%7D%0A%09%09in.close();%0A%09%7D%0A%0A%09public static boolean isInRange(int min, int max, int val) %7B%0A%09%09return (val %3E= min && val %3C= max);%0A%09%7D%0A%0A%7D%0A

Create FindTheMedian.java