191.Number Of 1 Bits

 Problem link => https://leetcode.com/problems/number-of-1-bits/

Code link => https://github.com/booleanbug/75-LeetCode/new/main

Logic =>

    First understand the unsigned format like uint8_t,uint16_t,uint32_t,uint64_t.

Then right shift the number and take & with one,so that you can see whether that bit is 1 or 0 then add it to final answer.

 

SIMPLE QUESTION.

Comments

Popular posts from this blog

3 MAPPING TECHNIQUES

VIRTUAL MEMORY

ADJACENT MATRIX