##
Find the transition point in a binary array
June 17, 2017

Given a sorted array containing only numbers 0 and 1, the task is to find the transition point efficiently. Transition point is a point where… Read More »

June 17, 2017

Given a sorted array containing only numbers 0 and 1, the task is to find the transition point efficiently. Transition point is a point where… Read More »

June 14, 2017

N light bulbs are connected by a wire. Each bulb has a switch associated with it, however due to faulty wiring, a switch also changes… Read More »

June 7, 2017

The problem is to check whether the decimal representation of the given binary number is divisible by 5 or not. Take care, the number could… Read More »

June 6, 2017

Given an array of 0s and 1s, in how many iterations the whole array can be filled with 1s if in a single iteration immediate… Read More »

May 17, 2017

Given a binary input that represents binary representation of positive number n, find binary representation of smallest number greater than n with same number of… Read More »

May 13, 2017

Given a binary input that represents binary representation of positive number n, find binary representation of n+1. The binary input may be and may not… Read More »

April 21, 2017

Given a string str, return true string follows pattern anbn, i.e., it has a’s followed by b’s such that the number of a’s and b’s… Read More »

April 20, 2017

Given an array of n integers containing only 0 and 1. Find the minimum toggles (switch from 0 to 1 or vice-versa) required such the… Read More »

March 9, 2017

A non-empty binary array A consisting of size N is given where, 0 represents a car traveling east, 1 represents a car traveling west. The… Read More »

February 26, 2017

Given binary array, find count of maximum number of consecutive 1’s present in the array. Examples: Input : arr[] = {1, 1, 0, 0, 1,… Read More »

February 20, 2017

Given two integers n and k, count the number of binary strings of length n with k as number of times adjacent 1’s appear. Examples:… Read More »

January 19, 2017

Given a Binary Number as string, print its 2’s complements. 2’s complement of a binary number is 1 added to the 1’s complement of the… Read More »

November 17, 2016

Given a binary string, that is it contains only 0s and 1s. We need to make this string a sequence of alternate characters by flipping… Read More »

November 7, 2016

Given a binary string (consists of only 0 and 1). If there is “100” as a sub-string in the string, then we can delete this… Read More »

September 15, 2016

Given a binary string, find if it is possible to make all its digits equal (either all 0’s or all 1’s) by flipping exactly one… Read More »