The Missing Term — Solution & Editorial
The true difference is (last − first)/M since exactly one term is missing. Scan for the adjacent pair whose gap is 2d and print the midpoint.
Complexity: O(M)
The true difference is (last − first)/M since exactly one term is missing. Scan for the adjacent pair whose gap is 2d and print the midpoint.
Complexity: O(M)