## Print all subarrays with 0 sum

You are given an integer array, your task is to print all the possible sub-arrays with sum is equal to 0. So we need to Print all subarrays with 0 sum. Example   arr[] = {-2, 4, -2, -1, 1, -3, 1, 5, 7, -11, -6} Sub-Array found from 0 index …

## Form minimum number from given sequence

The problem “Form minimum number from given sequence” states that you are given some pattern of I’s and D’s only. The meaning of I stands for increasing and for decreasing we are provided with D. The problem statement asks to print the minimum number which satisfies the given pattern. We have …

## Rearrange a binary string as alternate x and y occurrences

Problem Statement   Suppose you are given a binary string, and two numbers x and y. The string consists of 0s and 1s only. The problem “Rearrange a binary string as alternate x and y occurrences” asks to rearrange the string such that the 0 comes x times ⇒ 1 comes …

## Check if the given array can represent Level Order Traversal of Binary Search Tree

Problem Statement   The problem “Check if the given array can represent Level Order Traversal of Binary Search Tree” states that you are given a level order traversal of the binary search tree. And using the level order traversal of the tree. We need to efficiently find if the level order …

## Largest area rectangular sub-matrix with equal number of 1’s and 0’s

Problem Statement   Given a binary matrix of size n x m. The problem is to find the largest area rectangular sub-matrix with equal number of 1’s and 0’s. Example   Dimensions = 4 x 4 Matrix: 1 1 1 1 0 1 0 1 1 0 1 0 1 0 0 …

## Find the Only Repetitive Element Between 1 to N-1

In finding the only repetitive element between 1 to N-1 problem we have given an array of random integers within a range from 1 to n-1. There will be one number that is repeated. Your task is to find that number. Example   Input [2,3,4,5,2,1]A Output 2 Explanation 2 is the …

## Find Zeros to be Flipped so that Number of Consecutive 1’s is Maximized

Problem Statement   In the “Find Zeros to be Flipped so that Number of Consecutive 1’s is Maximized” problem we have given a binary array and a number x which denotes the no. of zeros to be flipped. Write a program to find the zeros that need to be flipped so … 