Frequency-counting - Basic Articles
Given a string str of size N consisting of lowercase English characters, the task is to find the minimum characters to be replaced to make… Read More
Given a string, str consisting of lowercase English alphabets, the task is to find the number of unique characters present in the string. Examples: Input:… Read More
Given a string S of size N, the task is to find the maximum sum of values assigned to all the alphabets of the string… 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 sorted array, arr[] consisting of N integers, the task is to find the frequencies of each array element. Examples:  Input: arr[] = {1,… Read More
Given two arrays A[] and B[] consisting of N positive integers and an integer K, the task is to find the Kth smallest element in… Read More
Given a string S consisting of N lowercase alphabets, the task is to modify the string S by replacing each character with the alphabet whose… Read More
Given a string S of length N, the task is to find the minimum number of characters required to be removed such that every distinct… Read More
Given a string S consisting of lowercase alphabets, the task is to check whether the given string can be rearranged such that the string can… Read More
Given a string S consisting of characters 0, 1, and ‘?’, the task is to count all possible combinations of the binary string formed by… Read More
Given a binary string, str of length N, the task is to find the maximum sum of the count of 0s on the left substring… Read More
Given an array arr[] of size N, the task is to find the minimum increments by 1 required to be performed on the array elements… Read More
Given an array arr[] of size N and an integer K, the task is to find an array element that contains the digit K a… Read More
Given two arrays, arr[] and brr[] of size N and M respectively, the task is to find the count of pairs (arr[i], brr[j]) such that… Read More
Given an array arr[] of size N, the task is to find the frequency of each distinct element present in the given array. Examples: Input:… Read More
Given an array arr[], the task is to find the length of the longest subsequence of the array arr[] such that all adjacent elements in… Read More
Given a string str and a character ch, where the button of character ch is not working correctly. After pressing that key, it toggles the… Read More
Given an array arr[] consisting of N positive integers, the task is to maximize the number of subsequences that can be obtained from an array… Read More
Given alphanumeric string str, the task is to rearrange the string such that no two adjacent characters are of the same type, i.e., no two… Read More
Given a binary array arr[] of size N, the task is to find the length of the second longest sequence of consecutive 1s present in… Read More