Easy C solution 100% 💡
💡 IntuitionWhen we look at a binary number like 5 = 101, its bitwise complement (within its significant bits) is 2 = 010.
If we perform a bitwise OR between the
# 💡 Intuition
When we look at a binary number like `5 = 101`, its bitwise complement (within its significant bits) is `2 = 010`.  
If we perform a bitwise OR between the number and its complement, we get a result with all bits set:  
`5 | 2 = 101 | 010 = 111`.  
This idea helps us construct the smallest number greater than or equal to `n` with all bits set starting from the most significant bit.

---

# 🚀 Approach
We build a **mask** with all bits set to `1` until it fully covers the significant bits of `n`.  
We shift the mask left and OR it with `1` repeatedly until `~mask & n == 0`, meaning that the mask now covers all bits in `n`.  
Finally, we return `n | mask`, which results in the smallest number ≥ `n` with all bits from the highest bit downward set to `1`.

---

# 🧠 Complexity

- **Time complexity:** $$O(\log n)$$  
  We loop through the number of bits in `n`.

- **Space complexity:** $$O(1)$$  
  Only a few integer variables are used.

---

# ✅ Code
```c []
int smallestNumber(int n) {
    int mask = 0;
    while((n & ~mask) != 0){
        mask = (mask << 1) | 1;
    }

    int comp = n ^ mask;

    return n | mask;
}
```
['C']