Update the maximum length of subsequence ending at element is a [ i ] in HashMap
if a [ i ] in map : NEW_LINE INDENT map [ a [ i ] ] = max ( map [ a [ i ] ] , dp [ i ] ) NEW_LINE DEDENT else : NEW_LINE INDENT map [ a [ i ] ] = max ( 1 , dp [ i ] ) NEW_LINE DEDENT