# Tag Archives: frequency-counting

Given an array arr[] of N integers, the task is to maximize the sum of selected numbers over all the operations such that in each… Read More
Given string str of size N consisting of only 0, 1, and 2, the task is to find the number of substrings that consists of… Read More
Given an array arr[] consisting of N pairs of the form {A, B}, the task is to count the pairs of indices (i, j) such… Read More
Given two strings str1 and str2 of same length N, the task is to check if there exists any permutation possible in any of the… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum number of array elements that must be removed such that… Read More
Given an array arr[] consisting of N integers, the task is to find the number of triplets whose indices and elements at that indices are… Read More
Given two integers L and R, the task is to find the count of integers in the range [L, R] such that the frequency of… Read More
Given an array arr[] consisting of N integers, the task is to find the maximum element with the minimum frequency. Examples: Input: arr[] = {2,… Read More
Given a string str[] of size N, the task is to encode it in such a way that the last occurrence of each character occurs… Read More
Given a binary string, the task is to print the length of the longest substring containing only ‘1’. Examples: Input: 110Output: 2Explanation: Length of the… Read More
Given an array arr[] of size N representing digits from 0 to 9, the task is to count the number of distinct odd N-digit integers… Read More
Given a string S, the task is to divide the characters of S to form minimum number of palindromic strings. Note: There can be multiple… Read More
Given an array arr[] consisting of N positive integers, the task is to count the number of pairs in the array, say (a, b) such… Read More
Given an array A[]of N strings of lowercase characters, the task is to find maximum number of strings, such that one character has majority i.e.… Read More
Given an array arr[] consisting of N integers, the task is to repeatedly select triplets and remove the maximum and minimum elements from the triplets… Read More