Brainfuck, 27 bytes
,.[->+>+<<]>[-[>>]>[.]<<<-] I ran it here
I used mod 2 instead of subtracting 48 to differentiate 0 and 1 which cuts down some characters.
,.[->+>+<<]>[-[>>]>[.]<<<-] I ran it here
I used mod 2 instead of subtracting 48 to differentiate 0 and 1 which cuts down some characters.