#What's this mean?

8 messages · Page 1 of 1 (latest)

smoky dome
#

parity ^= (1 << root.val); // Toggle the bit at the position of root.val

placid anvilBOT
#

This post has been reserved for your question.

Hey @smoky dome! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

gleaming jasper
#

<< means left shift

#

1 << something is essentially equivalent to 2 to the power of something

#

or in binary, a 1 followed by something 0s

#

then ^ is XOR

#

and ^= is XOR+=
i.e.

a ^= b;

is equivalent to

a = a ^ b;