package hackerrank;

/**
 * https://www.hackerrank.com/challenges/stockmax
 */
public class StockMaximize {
    public static void main(String[] args) {

    }
}

@@ -14,16 +14,43 @@
 rrank;%0A%0A
+import java.util.Scanner;%0A%0A
 /**%0A * h
@@ -137,48 +137,494 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A
+rivate static int maxProfit(int%5B%5D array) %7B%0A        // TODO%0A        return 0;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int testCases = in.nextInt();%0A        for (int t = 0; t %3C testCases; t++) %7B%0A            int n = in.nextInt();%0A            int%5B%5D array = new int%5Bn%5D;%0A            for (int i = 0; i %3C n; i++) %7B%0A                array%5Bi%5D = in.nextInt();%0A            %7D%0A            System.out.println(maxProfit(array));%0A        %7D
 %0A   

Update Stock Maximize