Skip to content

Tag Archives: HashSet

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
Find the largest possible string of distinct characters formed using a combination of given strings. Any given string has to be chosen completely or not… 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:… 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
Given an array A[] of length N, the task is to find lexicographically smallest array by swapping adjacent elements for each index atmost once. Thus,… Read More

Start Your Coding Journey Now!