Driver code
MAX = 1000 NEW_LINE arr = [ 1 , 2 , 3 , 4 , 6 ] NEW_LINE n = len ( arr ) NEW_LINE M = 4 NEW_LINE dp = [ [ - 1 ] * MAX for i in range ( n + 1 ) ] NEW_LINE res = isPossible ( n , 0 , 0 , M , arr , dp ) NEW_LINE if res : NEW_LINE INDENT print ( True ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( False ) NEW_LINE DEDENT