## Minimize the number of replacements to get a string with same number of ‘a’, ‘b’ and ‘c’ in it

Given a string consisting of only three possible characters ‘a’, ‘b’ or ‘c’. The task is to replace characters of the given string with ‘a’,… Read More »

- How can one become good at Data structures and Algorithms easily?
- Make all numbers of an array equal
- Reach the numbers by making jumps of two given lengths
- Some useful C++ tricks for beginners in Competitive Programming
- Check if a number is perfect square without finding square root
- Sum of XOR of all subarrays
- Sort the array of strings according to alphabetical order defined by another string
- Make Binary Search Tree
- Sum of similarities of string with all of its suffixes
- Check if it is possible to reach a number by making jumps of two given length
- Smallest Pair Sum in an array
- Find the number in a range having maximum product of the digits
- Maximum of all Subarrays of size k using set in C++ STL
- Print matrix in snake pattern from the last column
- Count distinct substrings that contain some characters at most k times
- Number of array elements derivable from D after performing certain operations
- Operations required to make the string empty
- Program to find the kth character after decrypting a string
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Minimum number of sets with numbers less than Y
- Find two numbers whose divisors are given in a random order
- Count common characters in two strings
- Sum of the multiples of two numbers below N
- Number of subarrays have bitwise OR >= K
- Given two arrays count all pairs whose sum is an odd number
- Sum of bitwise AND of all subarrays
- Use of FLAG in programming
- Maximum length substring with highest frequency in a string
- Interactive Problems in Competitive Programming
- Shortest Path using Meet In The Middle

Given a string consisting of only three possible characters ‘a’, ‘b’ or ‘c’. The task is to replace characters of the given string with ‘a’,… Read More »

Given a permutation P = p1, p2, …., pn of first n natural numbers (1 ≤ n ≤ 10). One can swap any two consecutive… Read More »

Given N seconds. The task is to check if it is possible to start from 12’0 clock and get back to 12 only adding or… Read More »

Given that integers are being read from a data stream. Find the median of all the elements read so far starting from the first integer… Read More »

Given an array arr[] of distinct elements -109 ≤ ai ≤ 109. The task is to find the largest sub-set from the given array such… Read More »

Given two strings str1 and str2, the task is to count all the valid strings. An example of a valid string is given below: If… Read More »

Depth First Search (DFS) marks all the vertices of a graph as visited. So for making DFS useful, some additional information can also be stored.… Read More »

Given an array of size N and an integer K, the task is to find the maximum for each and every contiguous sub-array of size… Read More »

Given an array arr[] which is the resultant array when a number of queries are performed on the original array. The queries are of the… Read More »

Given a number N. The task is to express N as sum two Abundant Numbers. If it is not possibe print -1. Examples: Input :… Read More »

Given a number N. FInd the sum of he all amicable numbers up to N. If A and B are Amicable pairs (Two numbers are… Read More »

Given an array arr[] and an integer K. The task is to find the size of the maximum sub-set such that every pair from the… Read More »

Given two numbers A and B, the task is to find the minimum number of operations required to make A and B equal. In each… Read More »

Given a Large number N ( number of digits in N can be up to 105). The task is to find the cuts required of… Read More »

Given a integer k and a sting str, the task is to count the number of distinct sub-strings such that each sub-string does not contain… Read More »