Given a string S of size N consisting of characters a, b, and c only, the task is to find the number of substrings of… Read More

# Tag Archives: frequency-counting

Given three strings S, X, and Y consisting of N, A, and B characters respectively, the task is to find the number of occurrences of… Read More

Given an array A[] of size N, the task is to generate an array B[] based on the following conditions: For every array element A[i], find the most frequent… Read More

Given a sorted array arr[] consisting of N positive integers and an integer D, the task is to find the number of triplets (i, j,… Read More

Given an array arr[] consisting of N positive integers, the task is to find an index from the array having count of prime numbers present… Read More

Given a string S consisting of N characters (representing the tasks to perform) and a positive integer K, the task is to find the minimum… Read More

Given a binary string S of size N, the task is to find the length of the longest non-increasing subsequence in the given string S.… Read More

Given string S consists of lowercase and uppercase letters, the task is to find the number of substrings having an equal number of lowercase and… Read More

Given an array arr[] consisting of N integers, the task is to count the number of distinct pairs (arr[i], arr[j]) in the array such that… Read More

Given a string S consisting of lowercase English alphabets, the task is to right shift each character of the given string S circularly by its… Read More

Given a string S and a character X, the task is to generate a non-palindromic string by inserting the character X in the string S.… Read More

Given an array arr[] consisting of N integers, the task is to find the number of pairs such that the GCD of any pair of… Read More

Given a string S consisting of N lowercase alphabets, the task is to count the number of substrings whose frequency of each character is even.… Read More

Given a string S consisting of N alphabets and two positive integers L and U, representing the cost of converting any character to lowercase and… Read More