Given a 2D binary matrix mat[][] of size N × M and two integers A, B, the task is to find the least number of… Read More
Tag Archives: frequency-counting
Given an array arr[] consisting of N integers and a positive integer M, the task is to find the number of array elements that occur… Read More
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 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 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