Compile
Mate
Problems
Contests
Compete
Battles
Daily Challenge
Achievements
Teams
Learn
Learning Paths
Certifications
AI Tutor
Community
Social Feed
Code Reviews
Snippets
Leaderboard
Career
Job Board
Resume Scanner
Shop
Sign In
Sign Up
Problems
Contests
Battles
Daily Challenge
Achievements
Teams
Learning Paths
Certifications
AI Tutor
Social Feed
Code Reviews
Snippets
Leaderboard
Job Board
Resume Scanner
Shop
Sign In
Sign Up
← Power of Two
Discussions
Sign in
to join the discussion.
S
snair
OFFICIAL
2 weeks, 2 days ago
Clean JavaScript solution, beats most submissions. XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 3 replies