human
Count even length binary sequences with same sum of first and second half bits | Returns the count of even length sequences.
Calculate SUM ( ( nCr ) ^ 2 ).
Compute nCr using nC ( r - 1 ) nCr / nC ( r - 1 ) = ( n + 1 - r ) / r.
.
Driver Code"
How can the above be solved in Python?
 Write me a code to count even length binary sequences with same sum of first and second half bits and the other steps required?
assistant
#Here is code to count even length binary sequences with same sum of first and second half bits and the other steps required.
 def countSeq ( n ) :
	nCr = 1
	res = 1
	for r in range ( 1 , n + 1 ) :
		nCr = ( nCr * ( n + 1 - r ) ) / r ;
		res += nCr * nCr ;
	return res ;
n = 2
print ( " Count ▁ of ▁ sequences ▁ is " ) ,
print ( int ( countSeq ( n ) ) )