## Maximum length subarray with difference between adjacent elements as either 0 or 1

Given an array of n integers. The task is to find the maximum length of the sub-array such that absolute difference between all the consecutive… Read More »

- Largest palindromic number in an array
- Longest subarray with elements having equal modulo K
- Maximum subarray sum in array formed by repeating the given array k times
- Count array elements that divide the sum of all other elements
- Count pairs with Bitwise XOR as EVEN number
- Array element with minimum sum of absolute differences
- Smallest subarray such that all elements are greater than K
- Maximize the difference between two subsets of a set with negatives
- Remove all continuous occurrences of 'a' and all occurrences of 'b'
- Minimum number of elements to be removed so that pairwise consecutive elements are same
- Minimum elements to be removed such that sum of adjacent elements is always odd
- Replace every element with the greatest element on its left side
- Index with Minimum sum of prefix and suffix sums in an Array
- Element equal to the sum of all the remaining elements
- Count number of pairs (i, j) such that arr[i] * arr[j] > arr[i] + arr[j]
- Maximum value of arr[i] % arr[j] for a given array
- Length of the longest substring with consecutive characters
- Absolute Difference of even and odd indexed elements in an Array
- Count Subarrays with Consecutive elements differing by 1
- Find the element whose multiplication with -1 makes array sum 0
- Find the only different element in an array
- Minimum number of given operations required to convert a string to another string
- Replace every element with the smallest element on its left side
- Minimum number of operations on an array to make all elements 0
- Generate lexicographically smallest string of 0, 1 and 2 with adjacent swaps allowed
- Check if a binary string contains consecutive same or not
- Minimum replacements to make adjacent characters unequal in a ternary string
- Check If every group of a's is followed by a group of b's of same length
- Students with maximum average score of three subjects
- Minimum score after flipping the cards

Given an array of n integers. The task is to find the maximum length of the sub-array such that absolute difference between all the consecutive… Read More »

Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of… Read More »

Given an array arr[], the task is to count the number of elements from the array which divide the sum of all other elements. Examples:… Read More »

Given an array Arr[] of N integers. The task is to find minimum number of elements needed to be removed from the array, so that… Read More »

Given an array arr[] of integers and an integer pos, the task is to find the minimum index i such that all the elements from… Read More »

Given two strings S and T of equal length. Both strings contain only the characters ‘0’ and ‘1’. The task is to find the minimum… Read More »

Given an array arr[] of N integers and an integer cost, the task is to calculate the cost of making all the elements of the… Read More »

Given a binary string str consisting of characters ‘0’ and ‘1’. The task is to find whether the string is valid or not. A string… Read More »

Given an integer k and an integer array arr[] of n elements, the task is to find the largest sub-array sum in the modified array… Read More »

Given a string of ‘0’, ‘1’ and ‘2’. The task is to find the minimum number of replacements such that the adjacent characters are not… Read More »

Given an array arr[] of N integers, the task is to find an element x from the array such that |arr[0] – x| + |arr[1]… Read More »

Given a string str containing only characters 0, 1 and 2, you can swap any two adjacent (consecutive) characters 0 and 1 or any two… Read More »

Given a string str of lowercase alphabets, the task is to find the length of the longest sub-string of characters in alphabetical order i.e. string… Read More »

Given a cyclic string str and two integers i and j, the task is to count the minimum number of steps required to move from… Read More »