Tag Archives: HashSet

Given an array a[] and an integer N, the task is to find all natural numbers from the range [1, N] that are nor present… Read More
Given a string str of length N and an integer K, the task is to check if a string has two non-overlapping substrings of length… Read More
Set: Set is a type of associative container which stores elements in a sorted manner. All the elements of a set are unique and can… Read More
Given an array arr[] consisting of N distinct integers and an integer K, the task is to find the maximum MEX from all subarrays of… Read More
Given an array arr[] consisting of N integers and 2D array queries[][] consisting of Q queries of the form {p, x}, the task for each… Read More
Given string str of length N only consisting of characters ‘N’, ‘S’, ‘E’, or ‘W’, each representing moving one unit North, South, East, or West,… Read More
Given an array arr[] of N positive integers, the task is to find the subarray having maximum sum among all subarrays having unique elements and… Read More
Given an array of strings arr[], the task is to find the maximum possible length of a string of distinct characters that can be generated… Read More
Given a Linked List consisting of integers, the task is to print the number of distinct absolute values present in the Linked List.Examples:  Input: -1… Read More
Given two arrays A[] and B[] consisting of N integers, the task is to check if each element of array B[] can be formed by… Read More
Given two integers [L, R], the task is to count the number of Primonacci Numbers in the range [L, R].  Primonacci Series: F(1) = F(2) =… Read More
Given an initial array, A[] and a final array B[] both of size N containing integers from the range [1, N], where A[] represent the… Read More
Given an array arr[] of N strings and an integer K, the task is to print K strings which occurred the most number of times… Read More
Given an integer array arr[] of size N, the task is to find the minimum distance between any most and least frequent element of the… Read More
Given an array arr[] consisting of N positive integers, the task is to print all pairs of array elements whose sum does not exist in… Read More