Minimizing array sum by applying XOR operation on all elements of the array

Given an array arr[] of N integer elements, the task is to choose an element X and apply XOR operation on every element of the… Read More »

Arrange array elements such that last digit of an element is equal to first digit of the next element

Given an array arr[] of integers, the task is to arrange the array elements such that the last digit of an element is equal to… Read More »

Find element with the maximum set bits in an array

Given an array arr[]. The task is to find an element from arr[] which has the maximum count of set bits. Examples: Input: arr[] =… Read More »

Count pairs with average present in the same array

Given an array arr[] of N integers where |arr[i] ≤ 1000| for all valid i. The task is to count the pairs of integers from… Read More »

Given two arrays count all pairs whose sum is an odd number

Given two arrays of N and M integers. The task is to find the number of unordered pairs formed of elements from both arrays in… Read More »

Maximum length of subarray such that sum of the subarray is even

Given an array of N elements. The task is to find the length of the longest subarray such that sum of the subarray is even.… Read More »

Reorder the position of the words in alphabetical order

Given an array arr[] of strings, the task is to reorder the strings lexicographically and print their positions in the original list. Examples: Input: arr[]… Read More »

Print the final string when minimum value strings get concatenated in every operation

Given an array of strings and an array of integers where ith integer of the array corresponds to the value of the ith string present… Read More »

Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time

Give an array arr[] of N integers and another integer k ≤ N. The task is to find the maximum element of every sub-array of… Read More »

Maximize the subarray sum after multiplying all elements of any subarray with X

Given an array arr[] of N integers and an integer X. We can choose any sub-array and multiply all its element by X. After multiplication,… Read More »

Minimum time required to transport all the boxes from source to the destination under the given constraints

Given two arrays box[] and truck[] where box[i] represents the weight of the ith box and truck[i] represents the maximum load that the ith truck… Read More »

Find the position of box which occupies the given ball

Given two array A[] and B[]. Where size of A[] represent the number of rows and A[i] represent the number of boxes in the ith… Read More »

Count of quadruplets with given Sum | Set 2

Given four arrays containing integer elements and an integer sum, the task is to count the quadruplets such that each element is chosen from a… Read More »

Find sum of factorials in an array

Given an array arr[] of N integers. The task is to find the sum of factorials of each element of the array. Examples: Input: arr[]… Read More »

Find the maximum cost of an array of pairs choosing at most K pairs

Given an array of pairs arr[], the task is to find the maximum cost choosing at most K pairs. The cost of an array of… Read More »