Lexicographically largest string formed from the characters in range L and R
Given a string S and a range L and R, the task is to print the lexicographically largest string that can be formed from the characters in range L and R....
read more
Sum of all odd frequency elements in an array
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 is the sum of all such elements whose frequency is odd in the array....
read more
Count substrings with each character occurring at most k times
Given a string S. Count number of substrings in which each character occurs at most k times. Assume that the string consists of only lowercase English alphabets....
read more
Python dictionary, set and counter to check if frequencies can become same
Given a string which contains lower alphabetic characters, we need to remove at most one character from this string in such a way that frequency of each distinct character becomes same in the string....
read more
Count of subtrees from an N-ary tree consisting of single colored nodes
Given a N-ary tree consisting of N nodes and a matrix edges[][] consisting of N – 1 edges of the form (X, Y) denoting the edge between node X and node Y and an array col[] consisting of values:...
read more
C# Program To Remove Duplicates From A Given String
Write a C# program for a given string S which may contain lowercase and uppercase characters. The task is to remove all duplicate characters from the string and find the resultant string....
read more
Calculate the frequency of each word in the given string
Given a string str, the task is to find the frequency of each word in a string....
read more
Minimum number of operations required to maximize the Binary String
Given a binary string S, the task is to find the minimum number of swaps required to be performed to maximize the value represented by S....
read more
Count of strings that does not contain any character of a given string
Given an array arr containing N strings and a string str, the task is to find the number of strings that do not contain any character of string str....
read more
Remove characters from string that appears strictly less than K times
Given a string of lowercase letters and a number K. The task is to reduce it by removing the characters which appear strictly less than K times in the string....
read more
Minimum time required to complete all tasks with alteration of their order allowed
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 time required to complete all the given tasks in any order, given that each task takes one unit of time and each task of the same type must be performed at an interval of K units....
read more
Split array into maximum subarrays such that every distinct element lies in a single subarray
Given an array, arr[] of size N, the task is to split the array into the maximum number of subarrays such that the first and the last occurrence of all distinct array element lies in a single subarray....
read more