category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

View the Project on GitHub mayankdutta/category-wise-problems

1009. Complement of Base 10 Integer

implementation ```cpp int bitwiseComplement(int n) { if (n == 0) return 1; int temp = n; int Size = 0; while (temp) { temp = temp >> 1; Size ++; } for (int i = 0; i < Size; i++) n ^= (1 << i); return n; } ```
more concise ```cpp int bitwiseComplement(int n) { if (n == 0) return 1; for (int temp = n, i = 0; (temp > 0); temp = temp >> 1, i++) n ^= (1 << i); return n; } ```