BETTER Hiring | Off-Campus OA (2025) | Find All Numbers Disappeared in an Array

Question · Posted Jun 2026

Find All Numbers Disappeared in an Array Problem Statement You are given an integer array nums of length n, where each element is in the range [1, n]. Some elements appear once, while others appear twice. Return a list of all the integers in the range [1, n] that do not appear in the array. Your solution should run in O(n) time and use constant extra space (excluding the output list). Example Input: nums = [4,3,2,7,8,2,3,1] Output: [5,6] Explanation: Numbers ...

The full answer & interview discussion are available to premium members.

Log in Create a free account