For this Question: Given a binary array (a binary array is an array consisting only of zeroes and ones) of size N. You can do following operation on the array any number of times. In an operation you can select any subarray of size 3 of the array such that all three elements of that subarray are not same and replace that subarray with a single element which is the element with frequency 2 in that subarray. For example if we are given array [0, 1, 0, 1, 1, 0] if we select subarray (0-2) then we will replace [0, 1, 0] with [0] so the array finally becomes [0, 1, 1, 0]. You have to find if it is possible to apply this operation some number of times to finally reduce the array to size 1.First line of input contains a single integer N, size of the array.
Second line contains N integers denoting the binary array.

Constraints:
3 <= N <= 100000
0 <= Arr[i] <= 1Print 1 if it is possible to finally reduce the array to size 1 else print 0.Sample Input 1
5
0 1 0 1 0

Sample Output 1
1

Explanation:
First we select subarray (0-2) array gets changed to 0 1 0
Second we select subarray (0-2) array gets changed to 0
As the size became 1 therefore it is possible.

Sample Input 2
5
1 1 1 1 0

Sample Output 2
0

Explanation -
First we select subarray (2-4) array gets changed to 1 1 1 1
Now we cannot do the operation anymore., I have written this Solution Code: a=int(input())
b=input().split(" ")
p=0
if b[0]=="1" and b[1]=="1" and b[2]=="1" and b[3]=="1" and b[4]=="1" and b[5]=="1":
	print(1)
	p=1
	exit(0)
bb=""
for i in b:
	bb=bb+i
b=bb
while len(b)!=1 and p==0:
	if "101" in b:
		b=b.replace("101","1")
	elif "110" in b:
		b=b.replace("110","1")
	elif "011" in b:
		b=b.replace("011","1")
	elif "010" in b:
		b=b.replace("010","0")
	elif "001" in b:
		b=b.replace("001","0")
	elif "100" in b:
		b=b.replace("100","0")
	else:
		break
if len(b)==1 and p==0:
	print("1")
elif p==0 and len(b)!=1:
	print("0"), In this Programming Language: Python, Now tell me if this Code is compilable or not?