Skip to content

Bug Report for number-of-one-bits #4660

@akib1689

Description

@akib1689

Bug Report for https://neetcode.io/problems/number-of-one-bits

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

Here, The solution for the problem is said to be O(1) running time. but the correct answer would be O(logn) running because each time I'm right shifting the number. Okay it's guaranteed that this loop will run at most 31 times for the worst case. but that In relative to n the time would be O(logn)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions