Skip to content

Category Archives: Arrays

Given two stacks stack1[] and stack2[] of size N and M respectively and an integer K, The task is to count the maximum number of… Read More
Given an array arr[] containing N positive integers, the task is to maximize the array sum when after every sum operation all the remaining array… Read More
Given an array arr[] of even length N and an integer K denoting the range of numbers in the array i.e. the numbers in the… Read More
Given an array of pairs arr[] of size N where the first value of all the pairs are distinct. For each pair of the given… Read More
Given an array arr[] containing N non-negative integers, the task is to find the maximum AND value among all the subsets having length K.  Examples: … Read More
Given an arr[ ] of size N, containing positive, negative integers and one zero. The task is to rearrange the array in such a way… Read More
Given an array arr[] of size N, the task is to remove all negative elements from this array. Examples: Input: arr[] = {3, -4}Output: {3}Explanation:… Read More
Given an array arr[] of N integers, the task is to replace each element of Array with their rank according to Rightmost-Set Bit (RSB) in… Read More
Given an array arr[] of N non-negative integers and an integer P (1 ≤ P ≤ 30), which denotes the upper limit of any number… Read More
Given a 2D array arr[][] of size N*M which denotes N arrays, each of size M. The task is to check if all these arrays… Read More
Given a string str and an array of words word[], the task is to find whether str is a prefix string of word[]. Examples: Input:… Read More
Given an array arr[] of size N. The task is to count the number of unique subsets.  Examples: Input: arr[] = {1, 2, 2}Output: 6Explanation:… Read More
Given an array arr[] of size N. The task is to maximize the minimum value of the array after performing given operations. In an operation,… Read More
Given a binary matrix of size M*N containing only 0 and 1. The task is to count the number of mappings in the matrix. There… Read More
Given an array arr[] of size N and an integer representing an index K, the task is to find the minimum number of operations in… Read More

Start Your Coding Journey Now!