Skip to content
Frequency-counting - Basic Articles
Given a string str consisting of alphanumeric characters, the task is to check whether the string contains all the digits from 1 to 9. Examples: … Read More
Given a chemical formula as a string, the task is to get the count of atoms in this chemical formula.Examples:   Input: str = "Fe2H3OH" Output:… Read More
Given two string s1 and s2, the task is to check if characters of the first string can be mapped with the character of the… Read More
Given two strings s1 and s2 consisting of lowercase English alphabets, the task is to count all the pairs of indices (i, j) from the… Read More
Given two strings str1 and str2 where str1 being the parent string. The task is to find out the number of string as str2 that… Read More
Given a matrix mat consisting of * and lowercase English alphabets, the task is to find the character which has the maximum number of *… Read More
Given an even length string S consisting of lower-case English alphabets only, we have two players playing the game. The rules are as follows:   the… Read More
Given a string. The task is to find the count of characters whose number of occurrences is prime. Examples:   Input : str = "geeksforgeeks" Output :… Read More
Given an array of integers, find the elements from the array whose frequency lies in the range [l, r]. Examples:  Input : arr[] = {… Read More
Given an array of integers, replace every element by its frequency in the array. Examples:  Input : arr[] = { 1, 2, 5, 2, 2,… Read More
Given an array of integers, remove all the occurrences of those elements which appear strictly more than k times in the array.Examples:  Input : arr[]… Read More
Given a string S and a range L and R, the task is to print the lexicographically largest string that can be formed from the… Read More
Given an array of integers containing duplicate elements. The task is to find the sum of all odd occurring elements in the given array. That… Read More
Given an array of integers containing duplicate elements. The task is to find the sum of all even occurring elements in the given array. That… Read More
Given an array of integers containing duplicate elements. The task is to find the sum of all highest occurring elements in the given array. That… Read More
Given an array of integers containing duplicate elements. The task is to find the sum of all least occurring elements in the given array. That… Read More
Given a string in such a way that every character occurs in a repeated manner. Your task is to print the string by inserting the… Read More
Given an array which may contain duplicates, print all elements and their frequencies. Examples:  Input : arr[] = {10, 20, 20, 10, 10, 20, 5,… Read More
Given an array, we have to find the sum of all the elements repeating k times in an array. We need to consider every repeating… Read More
Given two strings, we need to take the character which has the maximum occurrence in the first string, and then we have to check if… Read More