## Check if a string follows a^nb^n pattern or not

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 »

- Minimum given operations required to convert a given binary string to all 1's
- Minimum operations required to convert a binary string to all 0s or all 1s
- Modulo of a large Binary String
- Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1's
- Minimum number of Binary strings to represent a Number

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 »

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 »

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 »

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

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 »

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 »

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 »

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 »

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 »

Given a number n, find all binary sequences of length 2n such that sum of first n bits is same as sum of last n… Read More »

Given a string containing of ‘0’, ‘1’ and ‘?’ wildcard characters, generate all binary strings that can be formed by replacing each wildcard character by… Read More »

Given a binary string, count minimum number of subsequences to be removed to make it an empty string. Examples : Input: str[] = “10001” Output:… Read More »

Given a number n, count number of n length strings with consecutive 1’s in them. Examples: Input : n = 2 Output : 1 There… Read More »

Given two binary arrays arr1[] and arr2[] of same size n. Find length of the longest common span (i, j) where j >= i such… Read More »

Given a binary string, count number of substrings that start and end with 1. For example, if the input string is “00100101”, then there are… Read More »