mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python * sort() --> sorted()
This commit is contained in:
@ -7,10 +7,8 @@ The problem is :
|
||||
Given an ARRAY, to find the longest and increasing sub ARRAY in that given ARRAY and return it.
|
||||
Example: [10, 22, 9, 33, 21, 50, 41, 60, 80] as input will return [10, 22, 33, 41, 60, 80] as output
|
||||
'''
|
||||
from __future__ import print_function
|
||||
|
||||
def longestSub(ARRAY): #This function is recursive
|
||||
|
||||
|
||||
ARRAY_LENGTH = len(ARRAY)
|
||||
if(ARRAY_LENGTH <= 1): #If the array contains only one element, we return it (it's the stop condition of recursion)
|
||||
return ARRAY
|
||||
|
Reference in New Issue
Block a user