Yahoo India Web Search

Search results

  1. Missing Number - Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.

  2. Find All Numbers Disappeared in an Array - Given an array nums of n integers where nums [i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.

  3. Problem. Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example 1 : Input: nums = [3,0,1] Output: 2. Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.

  4. Aug 24, 2016 · By calculating the sum of $[0,..n]$, subtracting the sum of all numbers in the array, we can obtain the missing number. The time complexity is $O(n)$, where $n$ is the length of the array. The space complexity is $O(1)$.

  5. Problem: Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example 1: Input: nums = [3,0,1] Output: 2 Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing number in the range since it does not appear in nums.

  6. Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example 1: Input: nums = [3,0,1]

  7. Missing Number. Easy. Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Follow up: Could you implement a solution using only O(1) extra space complexity and O(n) runtime complexity? Example 1: Input: nums = [3,0,1] Output: 2.