Finding count of element between i - th and ( i - 1 ) - th element .
c = arr [ i ] - arr [ i - 1 ] - 1 ; NEW_LINE if ( k <= c ) : NEW_LINE INDENT return arr [ i - 1 ] + k ; NEW_LINE DEDENT else : NEW_LINE INDENT k -= c ; NEW_LINE DEDENT return arr [ n - 1 ] + k ; NEW_LINE