## Concatenate strings in any order to get Maximum Number of “AB”

Given an array of strings of length N, it is allowed to concatenate them in any order. Find the maximum possible number of occurrences of… Read More »

- Length of the longest alternating subarray
- Given two arrays count all pairs whose sum is an odd number
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum
- Number of array elements derivable from D after performing certain operations
- Program to find the kth character after decrypting a string
- Maximize the value of A by replacing some of its digits with digits of B
- Check if array can be divided into two sub-arrays such that their absolute difference is K
- Count of all possible values of X such that A % X = B
- Find sub-arrays from given two arrays such that they have equal sum
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- Minimum sum of two numbers formed from digits of an array in O(n)
- Distribute candies in a Binary Tree
- Split the array elements into strictly increasing and decreasing sequence
- Print the balanced bracket expression using given brackets
- Find the maximum possible value of a[i] % a[j] over all pairs of i and j
- Maximum water that can be stored between two buildings
- Delete odd and even numbers at alternate step such that sum of remaining elements is minimized
- Find if it is possible to make a binary string which contanins given number of "0", "1" , "01" and "10" as sub sequences
- Maximum number of candies that can be bought
- Generate permutation of 1 to N such that absolute difference of consecutive numbers give K distinct integers
- Minimum operations to make frequency of all characters equal K
- Minimize the number of replacements to get a string with same number of 'a', 'b' and 'c' in it
- Find the value of N when F(N) = f(a)+f(b) where a+b is the minimum possible and a*b = N
- Maximum distance between two unequal elements
- Count of pairs of strings which differ in exactly one position
- Number of submatrices with all 1s
- Minimum possible sum of array elements after performing the given operation
- Construct Binary Tree from given Parent Array representation | Iterative Approach
- Minimum number N such that total set bits of all numbers from 1 to N is at-least X
- Find original numbers from gcd() every pair

Given an array of strings of length N, it is allowed to concatenate them in any order. Find the maximum possible number of occurrences of… Read More »

Given an array Row[] of size R where Row[i] is the sum of elements of the ith row and another array Column[] of size C… Read More »

Given an integer N, the task is to find the MDAS factorial. The general factorial of a no. N is given by : Factorial(N) =… Read More »

Given an array arr[] of N integers, the task is to find the longest sub-sequence in the given array such that for all pairs from… Read More »

Given four integers l, m, x and y. The task is to check whether it is possible to make a binary string consisting of l… Read More »

Given an array arr[], the task is to find the maximum distance between two unequal elements of the given array. Examples: Input: arr[] = {3,… Read More »

Given an integer array which represents the heights of N buildings, the task is to delete N-2 buildings such that the water that can be… Read More »

Given an integer array arr[], and some queries consisting of an integer K, the task is to determine if its possible to make all the… Read More »

Given a balanced bracket sequence as a string str containing character ‘(‘ or ‘)’, the task is to find the next lexicographical order balanced sequence… Read More »

Given a positive integer N, the task is to find out all the combinations of positive integers that add upto the given integer N. The… Read More »

Given an array Q[] of length N, the task is to find the permutation P[] of integers from the range [1, N + 1] such… Read More »

Given an M x N matrix mat[][]. The task is to count the number of good cells in the matrix. A cell will be good… Read More »

Given two integers A and B. The task is to find the count of all possible values X such that A % X = B.… Read More »

Given an array arr[] of positive integers, the task is to find whether it is possible to make this array strictly increasing by modifying atmost… Read More »

Given a matrix mat[][], the task is to check if the given matrix is strictly increasing or not. A matrix is said to be strictly… Read More »