## Length of the longest substring with no consecutive same letters

Given a string str, the task is to find the length of the longest sub-string which does not have any pair of consecutive same characters.… Read More »

- Spanning Tree With Maximum Degree (Using Kruskal's Algorithm)
- Optimal File Merge Patterns
- Find Intersection of all Intervals
- Given count of digits 1, 2, 3, 4, find the maximum sum possible
- Find the maximum possible value of a[i] % a[j] over all pairs of i and j
- Maximum number of candies that can be bought
- Minimum number of pairs required to make two strings same
- Minimum elements to be removed such that sum of adjacent elements is always odd
- Minimum operations to make frequency of all characters equal K
- Rectangle with minimum possible difference between the length and the width
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Greedy approach vs Dynamic programming
- Maximum distance between two unequal elements
- Minimum cuts required to convert a palindromic string to a different palindromic string
- Check whether a subsequence exists with sum equal to k if arr[i]> 2*arr[i-1]
- Count all possible N digit numbers that satisfy the given condition
- Count common elements in two arrays containing multiples of N and M
- Find the minimum number of steps to reach M from N
- Find smallest number K such that K % p = 0 and q % K = 0
- Divide a number into two parts
- Maximal Disjoint Intervals
- Count possible moves in the given direction in a grid
- Find n positive integers that satisfy the given equations
- Find the sum of digits of a number at even and odd places
- Minimum LCM and GCD possible among all possible sub-arrays
- Find the Kth smallest element in the sorted generated array
- Count the pairs of vowels in the given string
- Create a Sorted Array Using Binary Search
- Minimum deletions required such that any number X will occur exactly X times
- Maximum count of sub-strings of length K consisting of same characters

Given a string str, the task is to find the length of the longest sub-string which does not have any pair of consecutive same characters.… Read More »

Given an array arr[] of size N. The task is to find the minimum number of changes required to convert the array such that for… Read More »

Given two unsorted arrays arr1[] and arr2[]. Find the sum of elements from arr1[] whose difference with the mean of arr2[] is < k. Examples:… Read More »

Given three integers N, X and Y. The task is to find N positive integers that satisfy the given equations. a12 + a22 + ….… Read More »

Given two integers N and M. The task is to find the minimum number of steps to reach M from N by performing given operations.… Read More »

Given an integers X. The task is to find the number of jumps to reach a point X in the number line starting from zero.… Read More »

Given an array arr[] of size n where arr[i] is the amount of candies of type i. You have unlimited amount of money. The task… Read More »

Given an array arr[] of n integers and an integer k. The task is to maximize the sum of the array after performing the given… Read More »

Given an undirected unweighted connected graph consisting of n vertices and m edges. The task is to find any spanning tree of this graph such… Read More »

Given a set of N intervals, the task is to find the maximal set of mutually disjoint intervals. Two intervals [i, j] & [k, l]… Read More »

Given the count of digits 1, 2, 3, 4. Using these digits you are allowed to only form numbers 234 and 12. The task is… Read More »

Given an array of positive and negative elements. The task is to replace every i-th element of the array by the absolute difference of absolute… Read More »

Given n number of sorted files, the task is to find the minimum computations done to reach Optimal Merge Pattern. When two or more sorted… Read More »

Given three non-zero integers a, b and c. The task is to find the maximum value possible by putting addition and multiplication signs between them… Read More »

Given palindromic string s, the task is to find minimum k, such that you can cut this string into k+1 parts, and then unite them… Read More »