Comment

Sebastian

Nice, that's a trick I haven't used before. I like it. :)

Parent comment

Brian

Ah, I found a way to solve this in python. I can define a hash indexed by true and false. e.g. {true: 0, false: 1}[a[i] == b[j]] does the same as a[i] == b[j] ? 0 : 1