Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Arturo Calderón
An easier approach

Arturo Calderón

Oct 24, 2023

def GetComplement(num): mask = 1 while mask < num: mask = mask << 1 mask += 1 return mask ^ 1

0

0

Comments
Comments

On this page