Meet your coaches
Talk through the problem while you code. Signed-in reps become prep memory for the next session.
Number of 1 Bits
Number of 1 Bits tests whether you're comfortable manipulating bits directly. The clean trick is `n &= n - 1`, which clears the lowest set bit each iteration, so you loop exactly once per one-bit. Interviewers watch whether you reach for bitwise reasoning instead of converting to a string and counting characters.
Learn this pattern
Bit Manipulation
Bit manipulation uses XOR, shifts, and masks to solve problems in O(1) space that would otherwise need hash maps. About 5 core tricks -- XOR for uniqueness, bit checks, Brian Kernighan's count -- cover 90% of interview bit problems.
Meet your coaches
Talk through the problem while you code. Signed-in reps become prep memory for the next session.
Chat with Fin or Coco right now on mobile.
Start talking through the problem here. Switch to desktop when you're ready to code and run tests.
Start coaching sessionStart a coached rep now. Sign in before or after the session so StrongYes can save what you struggled with to your prep memory.
Email me this coached-rep link
Desktop required
Sorry - mobile cannot run the editor and tests yet. Use the next step below or email yourself a link to continue on desktop.
Bit Manipulation gives you a useful next rep while you are still on your phone.