i ran my code for binary stirling numbers on ideone just fine, no errors except tle for large numbers, but here i'm getting runtime error, not sure why. here's my code
def stirling(n,m):
if n<m:
return 0
elif m == 0 and n == 0:
return 1
elif m == 0:
return 0
else:
return (m&stirling(n-1,m))^stirling(n-1,m-1)
cases = int(input())
while cases >0:
a,b = input().split()
print(stirling(int(a),int(b)))
cases -= 1