Skip to content

# Tag Archives: frequency-counting

Given an array arr[] consisting of N integers, the task is for each array element, say arr[i], is to find the number of array elements… Read More
Given an array A[] consisting of N integers and an integer K, the task is to count the minimum number of distinct elements present in… Read More
Given a string S representing a sequence of moves(L, R, U, and D) and an integer R representing the radius of a circle whose center… Read More
Given an array arr[] of size N, the task is to count the number of pairs (i, j) possible from the array such that arr[j]… Read More
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
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 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