Maximum And Minimum Subarray Geeksforgeeks Java