Given a string str, consisting of lowercase English alphabets, the task is to calculate the sum of indices(1-based indexing) of the characters removed to obtain… Read More
Tag Archives: frequency-counting
Given an array string[] consisting of N numeric strings of length M, the task is to find the number of distinct strings that can be… Read More
Given an array arr[] of length N containing array elements in the range [1, N], the task is to find the maximum number of pairs… Read More
Given a numeric string str, the task is to calculate the number of substrings with the sum of digits equal to their length. Examples: Input:… Read More
Given a string S and an integer K, the task is to find the number of substrings which consists of at least K pairwise distinct… Read More
Given a binary string S, the task is to find the minimum number of swaps required to be performed to maximize the value represented by… Read More
Given an array arr[] of N elements. The task is to count the total number of indices (i, j) such that arr[i] = arr[j] and… Read More
Given an integer N, the task is to find the number of Binary Strings of length N such that frequency of 1‘s is greater than… Read More
Given an array arr[] of length N, the task is to find the median of the differences of all pairs of the array elements. Example:… Read More
Given a Binary Tree and an integer D, the task is to check if the distance between all pairs of the same node values in… Read More
Given a string S of length N, consisting of lower case alphabets, and queries Q[][] of the form [L, R], the task is to count… Read More
Given an array arr[] of N integers. The task is to create a frequency array freq[] of the given array arr[] and find the maximum… Read More
Given an array A[] of size greater than integer K, the task is to find the total number of elements from the array which are… Read More