Yahoo India Web Search

Search results

  1. Given an array of size n-1 such that it only contains distinct integers in the range of 1 to n. Return the missing element. Examples: Input: n = 5, arr[] = [1,2,3,5] Output: 4 Explanation : All the numbers from 1 to 5 are present except 4.

  2. Given an array of size N-1 such that it only contains distinct integers in the range of 1 to N. Find the missing element. Example 1: Input: N = 5 A[] = {1,2,3,5} Output: 4 Example 2: Input: N = 10 A[] = {6,1,2,8,3,4,7,10,5} Outpu

  3. Ritu has all numbers from 1 to n in an array arr of length n-1 except one number. You have to find which number, Ritu doesn't have from 1 to n. NOTE: Don't use SortingExample 1: Input:n = 4 arr = {1, 4, 3} Out

  4. Jul 5, 2024 · The very basic idea is to use an array to store the frequency of each element in the given array. The number with a frequency of 0 is the missing number. Code Implementation:

  5. Find Missing and Repeated Values. Easy. You are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n 2]. Each integer appears exactly once except a which appears twice and b which is missing. The task is to find the repeating and missing numbers a and b.

  6. 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. Example 1: Input: nums = [3,0,1] Output: 2.

  7. Sep 5, 2021 · Find the missing number in an array. Given an array of n-1 distinct integers in the range of 1 to n, find the missing number in it in linear time. For example, consider array {1, 2, 3, 4, 5, 7, 8, 9, 10} whose elements are distinct and within the range of 1 to 10. The missing number is 6.