## Maximum Product Subarray | Set 3

Given an array A[] that contains both positive and negative integers, find the maximum product subarray. Examples: Input: A[] = { 6, -3, -10, 0,… Read More »

Given an array A[] that contains both positive and negative integers, find the maximum product subarray. Examples: Input: A[] = { 6, -3, -10, 0,… Read More »

The multiset equivalence problem states to check if two given multisets are equal or not. For example let A = {1, 2, 3} and B… Read More »

Given an array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find these… Read More »

Given an unsorted array with both positive and negative elements. Find the smallest positive number missing from the array in O(n) time using constant extra… Read More »

Given an array of N integers, the task is to find the number of operations required to make all elements in the array equal. In… Read More »

Given an array of distinct elements. The task is to find triplets in array whose sum is equal to a given number. Examples: Input :… Read More »

Given an array of integers, and a number ‘sum’, print all pairs in the array whose sum is equal to ‘sum’. Examples : Input :… Read More »

Given a number N which represents the total distance in km to be covered by a car on a single road. There are N petrol… Read More »

Given an array of N positive integers. The task is to find the sum of maximum sum decreasing subsequence(MSDS) of the given array such that… Read More »

We have already discussed arrays and vectors. In this post, we will discuss advantages of vector over normal array. Advantages of Vector over arrays :… Read More »

Given an array consisting of cost of toys. Given an integer K depicting the amount of money available to purchase toys. Write a program to… Read More »

Given an array A of N integers and a positive integer K. Only three operations can be performed on this array: 1) Replace an integer… Read More »

What is a dynamic array? A dynamic array is similar to an array, but with the difference that its size can be dynamically modified at… Read More »

Given an array of N integers, write a program that prints the length of the longest subarray such that adjacent elements of the subarray have… Read More »

Given an array of N integers. The bitwise OR of all the elements of the array has to be maximized by performing one task. The… Read More »