L [ i ] = { Max ( L [ j ] ) } + arr [ i ] where j < i and arr [ j ] . b < arr [ i ] . a
if ( arr [ j ] . b < arr [ i ] . a and len ( L [ j ] ) > len ( L [ i ] ) ) : NEW_LINE INDENT L [ i ] = L [ j ] NEW_LINE DEDENT L [ i ] . append ( arr [ i ] ) NEW_LINE