Skip to content

Category Archives: Greedy

Given a binary string str of size N whose every character is either ‘1’ or ‘0’. The task is to select minimum number of 0‘s… Read More
Given a string S of lowercase English alphabets, the task is to find the minimum number of characters to be changed such that the left… Read More
Given a string S of lowercase English alphabets, the task is to find the minimum number of characters to be changed such that the left… Read More
Given a string S of lowercase English alphabets, the task is to find the minimum number of characters to be changed such that the left… Read More
Given N ranges of the form [L, R], the task is to find the sum of all integers that lie in any of the given… 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 two positive integers N and X. The task is to print the maximum median possible by generating an Array of size N with sum… Read More
Given an array arr[]. The task is to create the smallest K digit number divisible by all numbers of arr[]. Examples: Input: arr[] = {2,… Read More
Given two strings A and  B, the task is to find the shortest string which is some multiple of both A and B. A string… Read More
Given an array arr[] of even size, the task is to find the count of pairs after partitioning arr[] into pairs, such that: each element… Read More

Start Your Coding Journey Now!