## Binary representation of next number

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 »

- Generate all the binary strings of N bits
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Check if a binary string has two consecutive occurrences of one everywhere
- Number of Binary Strings of length N with K adjacent Set Bits
- Recursive Program for Binary to Decimal
- Occurrences of a pattern in binary representation of a number
- Minimum number of given operations required to convert a string to another string
- Length of longest consecutive ones by at most one swap in a Binary String
- Minimum number of operations required to sum to binary string S
- Check if all the 1's in a binary string are equidistant or not
- Count of cyclic permutations having XOR with other binary string as 0
- Check if moves in a stack or queue are possible or not
- Deletions of "01" or "10" in binary string to make it free from "01" or "10"
- Bitwise AND of N binary strings
- Count of values of x <= n for which (n XOR x) = (n - x)
- Check if a binary string contains consecutive same or not
- Maximum consecutive one’s (or zeros) in a binary circular array
- Ways to divide a binary array into sub-arrays such that each sub-array contains exactly one 1
- Check If every group of a's is followed by a group of b's of same length
- Find Bit whose minimum sequence flips makes all bits same
- Construct a binary string following the given constraints
- Minimum number of moves to make a binary array K periodic
- Minimum number of operations on a binary string such that it gives 10^A as remainder when divided by 10^B
- Find the n-th binary string in sorted order
- Number of ways to make binary string of length N such that 0s always occur together in groups of size K
- Minimum steps to convert one binary string to other only using negation
- Generate all binary strings of length n with sub-string "01" appearing exactly twice
- Print n 0s and m 1s such that no two 0s and no three 1s are together
- Remove one bit from a binary number to get maximum value
- Modify a binary array to Bitwise AND of all elements as 1

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 »

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 »