Back to problems

Missing Number (Not Starting From 0, Binary Search Variant)

Algorithm · Arista · Medium

You are given an integer start and a strictly increasing array nums of length n. The full consecutive range [start, start + n] contains exactly n + 1 integers. Exactly one value from that range is absent from nums; all other values in the range appear exactly once in the array. Your task is to identify and return the missing integer. Because the missing value is unique and the array is sorted, both linear‑time approaches (using arithmetic sums or XOR) and an optimal…

Loading the rest of the question…