Yahoo India Web Search

Search results

  1. Dec 14, 2023 · Given an array arr of N elements, the task is to find the length of the smallest subarray of the given array that contains at least one duplicate element. A subarray is formed from consecutive elements of an array.

  2. Program to print the duplicate elements of an array. In this program, we need to print the duplicate elements present in the array. This can be done through two loops. The first loop will select an element and the second loop will iteration through the array by comparing the selected element with other elements.

  3. Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice. You must write an algorithm that runs in O(n) time and uses only constant extra space.

  4. Array Duplicates. Difficulty: Easy Accuracy: 18.95% Submissions: 716K+ Points: 2. Given an array arr of size n which contains elements in range from 0 to n-1, you need to find all the elements occurring more than once in the given array. Return the answer in ascending order.

  5. May 7, 2024 · Find the two repeating elements in a given array. Approach 1 ( Using hashmap): Use the input array to store the frequency of each element.

  6. Sep 30, 2018 · Find a duplicate in an array. Given an array of n + 1 integers between 1 and n, find one of the duplicates. If there are multiple possible answers, return one of the duplicates. If...

  7. Jan 21, 2019 · There are many methods through which you can find duplicates in array in java. In this post, we will learn to find duplicate elements in array in java using Brute Force method, using Sorting method, using HashSet, using HashMap and using Java 8 Streams. Let’s see them one by one.

  1. People also search for