Quant Memo
Coding/●●●●

The missing trade sequence number

A gap-free feed should deliver sequence numbers 1 through n, but exactly one is missing, so you receive n - 1 distinct numbers in some order. Find the missing one.

seqs = [1, 2, 4, 5], n = 5
-> 3

Return the missing number. Aim for O(n)O(n) time and O(1)O(1) space.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions