## Sort 1 to N by swapping adjacent elements

Given an array A of size N consisting of elements 1 to N. A boolean array B consisting of N-1 elements indicates that if B[i]… Read More »

- Maximum contiguous 1 possible in a binary string after k rotations
- Number of Binary Strings of length N with K adjacent Set Bits
- Divide binary array into three equal parts with same value
- Check if a binary string has two consecutive occurrences of one everywhere
- Minimum number of 1's to be replaced in a binary array
- Minimum swaps required to convert one binary string to another
- Recursive Program for Binary to Decimal
- Minimum number of operations required to sum to binary string S
- Occurrences of a pattern in binary representation of a number
- Length of longest consecutive ones by at most one swap in a Binary String
- Minimum swaps required to make a binary string alternating
- Minimum number of given operations required to convert a string to another string
- Number of steps required to convert a binary number to one
- Count of values of x <= n for which (n XOR x) = (n - x)
- 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"
- Count of cyclic permutations having XOR with other binary string as 0
- Generate all the binary strings of N bits
- Check if a binary string contains consecutive same or not
- Bitwise AND of N binary strings
- Ways to divide a binary array into sub-arrays such that each sub-array contains exactly one 1
- Number of unique permutations starting with 1 of a Binary String
- Minimum steps to remove substring 010 from a binary string
- Lucky alive person in a circle | Set - 2
- Check If every group of a's is followed by a group of b's of same length
- Check if it is possible to rearrange a binary string with alternate 0s and 1s
- Construct a binary string following the given constraints
- Minimum number of moves to make a binary array K periodic
- Find the n-th binary string in sorted order
- Find Bit whose minimum sequence flips makes all bits same

Given an array A of size N consisting of elements 1 to N. A boolean array B consisting of N-1 elements indicates that if B[i]… Read More »

Given a decimal number m, convert it into a binary string and apply n iterations, in each iteration 0 becomes “01” and 1 becomes “10”.… Read More »

Given a binary string of 0s and 1s. The task is to find the maximum difference between the number of 0s and number of 1s… Read More »

Given a binary string of size N. Count all substring that have even decimal value considering binary to decimal conversion from left to right (For… Read More »

Given K and a binary number, check if there exists k consecutive 1’s in the binary number. Examples: Input : binary number = 101010101111 k… Read More »

Given a binary string containing only 0’s and 1’s. Write a program to find number of sub-strings of this string whose decimal representation is odd.… Read More »

Given an array arr[] of size n containing 0 and 1 only. The problem is to count the subarrays having equal number of 0’s and… Read More »

Given a binary array a[] and a number k, we need to find length of he longest subsegment of ‘1’s possible by changing at most… Read More »

Given a binary string of 0s and 1s. The task is to find the length of substring which is having maximum difference of number of… Read More »

Given a string containing characters ‘a’ and ‘b’ only. Convert the given string into a string in which there is no ‘ab’ substring. To make… Read More »

Given a binary array, we can flip all the 1 are in the left part and all the 0 to the right part.Calculate the minimum… Read More »

Given a binary array, the task is find the size of the largest sub_sequence which having equal number of zeros and one. Examples : Input… Read More »

Given an integer n. Find a string of characters ‘a’ and ‘b’ such that the string doesn’t contain any palindrome of length 3. Examples: Input… Read More »

Given a binary string, find the longest subsequence of the form (0)*(1)*(0)* in it. Basically we need to divide the string into 3 non overlapping… Read More »

Given a binary array, find length of the longest subsequence such that there is no 0 after a 1. Examples: Input : 1 1 0… Read More »