educative.io

Educative

Number Of Flips Required To Make a|b Equal to c

This question is regarding the time complexity mentioned in the code for: Number Of Flips Required To Make a|b Equal to c in Grokking Bit Manipulation course.

Time complexity is mentioned as: log(n). How?
It should be O(1) - loop iterates for 32 times always for int.


Course: Grokking Bit Manipulation for Coding Interviews - Learn Interactively
Lesson: Number Of Flips Required To Make a|b Equal to c - Grokking Bit Manipulation for Coding Interviews