Skip to content

Tag Archives: HashSet

Given an array arr[] consisting of N integers, the task is to find the largest number K (> 0) such that both the values K… Read More
Given an array arr[] consisting of (N – 1), the task is to construct a permutation array P[] consisting of the first N Natural Numbers… Read More
Given two integers S and D, the task is to check if the integer S can be made divisible by D or not by repeatedly… Read More
Given a string S of size N consisting of lowercase alphabets, the task is to print the length of the longest substring consisting only of… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to print all possible unique quadruplets (arr[i], arr[j], arr[k], arr[l])… Read More
Given an array arr[] consisting of N integers, the task is to count the number of distinct pairs (arr[i], arr[j]) in the array such that… Read More
Given an array arr[] consisting of N strings, the task is to find the pair of strings that is not present in the array formed… Read More
Given an array arr[] consisting of N strings where each string represents an email address consisting of English alphabets, ‘.’, ‘+’ and ‘@’, the task… Read More
Given a string S consisting of lowercase English alphabets, the task is to find the number of unique characters present in the string. Examples: Input:… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find a subarray of size K with maximum sum… Read More
Given a string S representing a sequence of moves(L, R, U, and D) and two integers X and Y representing the starting coordinates, the task… Read More
Given a Binary Tree, the task is to find the count of diagonal paths to the leaf of a binary tree such that values of… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the count of array elements whose… Read More
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