Please Help me to know the error in my code of October cookoff problem i.e. D-OR.

It doesn’t even pass the example in the problem.

def decimalToBinary(n,a):

```
if(n > 1):
a = decimalToBinary(n//2,a)
a.append(n%2)
return a
```

t = int(input())

for _ in range(t):

```
l,r = map(int,input().split())
a = list()
c1 = list(decimalToBinary(r,a))
a = list()
c2 = list(decimalToBinary(l,a))
if(len(c2)!=len(c1)): # If len(c1)>len(c2)
c2.reverse() # Equating length
while(len(c2)!=len(c1)):
c2.append(0)
c2.reverse()
ind = len(c1)-1
k = 0
while(k<len(c1)):
if(c1[k] == c2[k]):
k += 1
else:
ind = k
break
for i in range(len(c1)-ind-1,-1,-1):
c1[i] = 1
ans = 0
for i in range(len(c1)):
if(c1[i]==1):
ans += pow(2,i)
else:
ans += 0
print(ans)
```