Frequency-counting - Basic Articles
Given an array arr[] of size N, the task is to find the length of the longest subsequence consisting of distinct elements only. Examples:  Input:… Read More
Given an array arr[] of size N consisting of equal length strings, the task is to check if it is possible to make all strings… Read More
Given a string S and an integer N, the task is to check if it is possible to generate any string N times from the… Read More
Given a binary array arr[] consisting of N elements, the task is to find the maximum possible length of a subarray of only 1’s, after… Read More
Given an array A[] consisting of N integers, the task is to find the total number of subsequence which contain only one distinct number repeated… Read More
Given an array a of integers of size N integers, the task is to find the ratio of positive numbers, negative numbers and zeros in… Read More
Given a string str consisting of alphanumeric characters, the task is to check whether the string contains all the digits from 1 to 9.  The… 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 strings 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 a linked list. Find the first element from the left which appears more than once. If all the elements are unique then print -1.Examples:… Read More
Given an unsorted array with both positive and negative elements including 0. The task is to find the smallest positive number missing from the array… 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 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 an integer K and two arrays A1 and A2, the task is to return the total number of pairs (one element from A1 and… 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 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