This is a verified interview question from Arm. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Missing Number in Sequence - ARM Online Assessment DTU" covers key patterns like Arrays.
"You are given a sequence of **4 numbers** represented as a string. The sequence follows these conditions: * `1st number = (2nd number / 2) - 2` * `2nd number = (3rd number / 3) - 3` * `3rd number = (4th number / 4) - 4` One number in the sequence is missing, and the remaining numbers are given in the string format. Your task is to **find the missing number**. The length of the input string can be as large as `10^5`. ### Input A string `s` representing the sequence, where **one of the four numbers is missing**. ### Output Print the **missing number**. ### Constraints ```text 1 ≤ |s| ≤ 10^5 ``` ### Example Suppose the sequence is: ```text 8 20 69 292 ``` Check: ```text 20 / 2 - 2 = 8 69 / 3 - 3 = 20 292 / 4 - 4 = 69 ``` So if the input is: ```text 8 20 ? 292 ``` the missing number is: ```text 69 ```"
Join thousands of developers practicing for Arm.