Frequency-counting - Basic Articles
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, 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
Write a python code to find the frequency of each word in a given string. Examples: Input : str[] = "Apple Mango Orange Mango Guava… Read More
You are given a string s (only lowercase alphabet) with length n. Print the position of every character of the string it must acquire so… Read More
Given a string, find minimum number of changes to it so that all substrings of the string become distinct. Examples :  Input : str =… Read More
Given an array, find the least frequent element in it. If there are multiple elements that appear least number of times, print any one of… Read More
You are given two strings str1 and str2. You have to check if the two strings share a common substring. Examples :  Input : str1… Read More
Given a string ‘s’ and an integer k, find other string ‘t’ such that ‘t’ is the largest subsequence of given string ‘s’ and each… Read More
Earlier we have discussed on how to check if both halves of the string have same set of characters. Now, we further extend our problem… Read More
Given a string s, find the number of pairs of characters that are same. Pairs (s[i], s[j]), (s[j], s[i]), (s[i], s[i]), (s[j], s[j]) should be… Read More
Given two strings str1 and str2 of length n1 and n2 respectively. The problem is to find the length of the longest subsequence which is… Read More
Given a string S. The task is to check whether a the given string is Heterogram or not. A heterogram is a word, phrase, or… Read More
Write a function to check whether two given strings are anagram of each other or not. An anagram of a string is another string that… Read More
Given a string, sort it in descending order. Examples:  Input : alkasingh Output : snlkihgaa Input : nupursingh Output : uusrpnnihg Input : geeksforgeeks Output… Read More
Given an unsorted array of n integers which can contains n integers. Count frequency of all elements that are present in array. Examples: Input :… Read More
Given a string S which may contain lowercase and uppercase characters. The task is to remove all duplicate characters from the string and find the… Read More