human
Making zero array by decrementing pairs of adjacent | Python3 implementation of the above approach.
converting array element into number.
Check if divisible by 11.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to making zero array by decrementing pairs of adjacent and the other steps required.
 def isPossibleToZero ( a , n ) :
	num = 0 ;
	for i in range ( n ) :
		num = num * 10 + a [ i ] ;
	return ( num % 11 == 0 ) ;
arr = [ 0 , 1 , 1 , 0 ] ;
n = len ( arr ) ;
if ( isPossibleToZero ( arr , n ) ) :
	print ( " YES " ) ;
else :
	print ( " NO " ) ;