Given an array arr[] and an odd integer N, the task is to check if N numbers can be selected from the array having even… Read More

# Tag Archives: frequency-counting

Given a numeric string str, the task is to determine the winner of the game when two players play a game optimally with the string… Read More

Given two strings P and Q, the task is to generate a string S satisfying the following conditions: Find S such that P is rearranged… Read More

Given an array of N distinct integers. For each lement the task is to find the count of subsequence from all the possible subsequence whose… Read More

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

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