Given a string str of length N. The task is to print the frequency of adjacent repeating characters. Examples: Input: str = “Hello”Output: l: 2Explanation:… Read More

# Tag Archives: frequency-counting

Given a ternary string S consisting of only three characters, the task is to find the count of ordered triplets (i, j, k) such that… Read More

Given a number N, the task is to find the distinct Prime Factors of N. Examples: Input: N = 12Output: 2 3Explanation: The factors of… Read More

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 an integer array arr[] of size N and a positive integer K, the task is to count all the pairs in the array with… Read More

Given an array of strings arr[], the task is to find the smallest string which contains all the characters of the given array of strings.… Read More

Given an array arr[], the task is to find the number of times the current integer has already occurred during array traversal. Examples: Input: arr[]… Read More

Given N lowercase sentences, the task is to find the minimum count of words among all of these sentences. Examples: Input: arr[] = { “there is… Read More

Given an array of strings arr[]. The task is to generate the string which contains all the characters of all the strings present in array… 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 an array arr[] of size N, The task is to find the length of the smallest subarray consisting of all the occurrences of maximum… Read More

Given an array arr[] of size n, The task is to find the GCD of the highest and lowest frequency element in the given array.… Read More

Given an array arr containing N positive integers, sort them according to the increasing modulus of their values with their frequencies. Example: Input: arr[]={1, 1,… Read More