Skip to content

Tag Archives: frequency-counting

Given two strings S1, S2 of length N and M respectively, and two positive integers N1 and N2, the task is to find the maximum… Read More
Given a string S consisting of N lowercase alphabets, the task is to find the length of the smallest substring in S whose occurrence is… Read More
Given an array arr[] consisting of N integers and a positive integer K, the task is to count the number of subarrays having exactly K… Read More
Given a positive integer N, the task is to print the nearest power of 2 of the frequencies of each digit present in N. If… Read More
Given a string S consisting of characters 0, 1, and ‘?’, the task is to count all possible combinations of the binary string formed by… 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 an array arr[] consisting of N positive integers, the task is to find the nearest perfect power of 2 of the nearest perfect squares… Read More
Given an integer N, the task is to print all the repeating digits present in N in sorted order. Examples: Input: N = 45244336543Output: 3… Read More
Given a string S consisting of lowercase English alphabets, the task is to find the length of the longest subsequence from the given string such… Read More
Given a string S consisting of lowercase English alphabets, the task is to find the minimum number of characters required to be removed such that… Read More
Given an array arr[] of N integers, the task for each array element is to find the number of ways of choosing a pair of… Read More
Given an array arr[] of size N, the task is to find the minimum number of array elements required to be removed such that the… Read More
Given an array arr[] consisting of 2*N integers, the task is to check if it is possible to rearrange the array elements such that arr[2… Read More
Given two strings S1 and S2 of lengths M and N respectively, the task is to calculate the sum of the frequencies of the characters… Read More
Given two arrays switch[], consisting of binary integers denoting whether a switch is ON(0) or OFF(1), and query[], where query[i] denotes the switch to be… Read More