## Length of longest consecutive ones by at most one swap in a Binary String

Given a Binary String of length . It is allowed to do at most one swap between any 0 and 1. The task is to… 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
- 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
- Minimum number of operations on a binary string such that it gives 10^A as remainder when divided by 10^B
- 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
- 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
- Find the n-th binary string in sorted order
- Generate all binary strings of length n with sub-string "01" appearing exactly twice
- Remove one bit from a binary number to get maximum value
- Print n 0s and m 1s such that no two 0s and no three 1s are together
- Modify a binary array to Bitwise AND of all elements as 1
- Calculate score for the given binary string

Given a Binary String of length . It is allowed to do at most one swap between any 0 and 1. The task is to… Read More »

Given a binary string consisting only of 1’s and 0’s. Find the bit (output is either 1 or 0)whose the minimum number of contiguous sequence… Read More »

Given a string str containing only characters x and y, the task is to perform the following operations while possible: Find an index such that… Read More »

Given a binary number, the task is to remove exactly one bit from it such that, after it’s removal, the resultant binary number is greatest… Read More »

Given two binary strings A and B, the task is to convert A to B by choosing any sub-string of A and negating it (replace… Read More »

Given two binary strings and . Let be set of all the cyclic permutations of string . The task is to find how many strings… Read More »

Given a binary array arr[] of zero’s and one’s only. The task is to find the minimum number of one’s to be changed to zero… Read More »

Given a binary string, the task is to count the minimum steps to remove substring “010” from this binary string. Examples: Input: binary_string = “0101010”… Read More »

Given a binary string of length at-least two. We need to check if it is possible to rearrange a binary string such that there alternate… Read More »

Given an array A of length n such that it contains only ‘0s’ and ‘1s’. The task is to divide the array into THREE different… Read More »

You are given a binary string str of length n. Suppose you create another string of size n * k by concatenating k copies of… Read More »

Given a sequence of ‘n’ numbers (without leading zeros), the task is to find whether it is possible to create a binary string by concatenating… Read More »

You are given a binary string of even length and equal number of 0’s and 1’s. What is the minimum number of swaps to make… Read More »

Given a string consisting of only 0’s and 1’s. Now you are given N non-intersecting ranges L, R ( L <= R), more specifically [L1,… Read More »

Given two binary string M and N of equal length, the task is to find a minimum number of operations (swaps) required to convert string… Read More »