@@ -0,0 +1,2115 @@
+/*%0Ahttps://www.hackerrank.com/challenges/maxsubarray%0AAuthor: Vaibhav Sahu%0A*/%0A%0Aimport java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A    public static void printMaxSum(ArrayList%3CInteger%3E arr)%7B%0A    int max_ending_here = 0;%0A    int max_so_far = Integer.MIN_VALUE;%0A    for(int i : arr)%7B%0A        max_ending_here = Math.max(i, max_ending_here+i);%0A        max_so_far = Math.max(max_so_far, max_ending_here);%0A    %7D%0A    System.out.print(max_so_far + %22 %22);%0A%0A    Collections.sort(arr);%0A    int sum = 0;%0A    if(arr.get(arr.size()-1) %3C= 0)%7B%0A        sum = arr.get(arr.size()-1);%0A    %7Delse%0A    %7B%0A        for(int i : arr)%7B%0A            if(i %3E 0)%7B%0A                sum+=i;%0A            %7D%0A        %7D%0A    %7D%0A    System.out.println(sum);%0A%7D%0A%0A    public static void main(String%5B%5D args) throws IOException%7B%0A        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */%0A                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));%0A        String read;%0A        StringTokenizer st;%0A%0A        ArrayList%3CArrayList%3CInteger%3E%3E listoflist = new ArrayList%3CArrayList%3CInteger%3E%3E();%0A        while ((read = bufferedReader.readLine()) != null && read.length() %3E= 1) %7B%0A                st = new StringTokenizer(read, %22 %22);%0A            ArrayList%3CInteger%3E list = new ArrayList%3CInteger%3E();%0A                while (st.hasMoreTokens())%7B%0A                    list.add(Integer.parseInt(st.nextToken()));%0A                %7D%0A                listoflist.add(list);%0A            %7D%0A%0A//        Iterator%3CArrayList%3CInteger%3E%3E it = listoflist.iterator();%0A//        while(it.hasNext())%7B%0A//            Iterator%3CInteger%3E it1 = it.next().iterator();%0A//            while(it1.hasNext())%7B%0A//                System.out.println(it1.next());%0A//            %7D%0A//        %7D%0A%0A        ArrayList%3CInteger%3E loop = listoflist.get(0);%0A        int loopcount =loop.get(0);%0A        for (int i = 2; i %3C= loopcount*2; i=i+2) %7B%0A            ArrayList%3CInteger%3E array = listoflist.get(i);%0A            printMaxSum(array);%0A        %7D%0A%0A    %7D%0A%7D%0A

Create MaxSumSubArray.java