Count binary strings with twice zeros in first half - GeeksforGeeks
We are given an integer N. We need to count the total number of such binary strings of length N such that the number of '0's in the first string of length N/2 is double of the number of '0's in the second string of length N/2.
Note: N is always an even positive integer.
Examples:
Input : N = 4
Output : 2
Explanation: 0010 and 0001 are two binary string such that the number of zero in the first half is double the number of zero in second half.
Read full article from Count binary strings with twice zeros in first half - GeeksforGeeks
No comments:
Post a Comment