Maximum And Minimum Subarray Geeksforgeeks Sql Query