^1Ṿ€
Try it online!
Explanation:
First of all, if you're familiar with Jelly, you might've noticed that I'm trying to bitwise-xor with a string. That sounds all sorts of ridiculous at first, but Jelly actually supports vectorized bitwise-xor'ing with strings, where each char, if it's a digit from 1 to 9, it's treated as such, otherwise it's treated as 0. The only chars in the string will in this case be '0'
and '1'
, being treated as themselves, as previously specified. So, bitwise-xor'ing then with 1
will return 0 ^ 1 = 1
for every '0'
and 1 ^ 1 = 0
for every '1'
in the string. Right now, our output is a list of 0
s and 1
s, so it's not yet in the correct format. We right now have to find a way to concatenate the integers into a single string, and we don't have a builtin for that. Fortunately, strings in Jelly are lists of 1-char Python strings, so we can simply take the string representation of each of the integers in the list. But wait! That builtin costs us 2 bytes, so let's see if there's a shorter builtin...and there is! Behold the uneval builtin! Unevaling an integer just takes its Jelly string representation, which, for integers, is equivalent to Python's string representation. So why not use it? That's what we'll do, to actually finish our program.
^1Ṿ€ Main link, monadic
^1 XOR each char with 1, as specified above
Ṿ€ Uneval each resulting integer