Top Tweets for #BitManipulation
#DSA #BitManipulation
Problem Link:https://t.co/Mrv7q8jr4u
Approach and Expalnation:
This is just an extension of above question what we will do instead of calculating bitwise or of each pair we will calculate valid pairs of 0 and 1 for each bit from 0 to 31 and we will add the weight of every bit to the final ans.
weight=ans+(1<<i)*(number of valid pair);
TC->O(32 · N)
SC->O(1)

#DSA #BitManipulation
Problem:->Given a binary array (containing only 0 and 1), find the sum of A[i] | A[j] over all pairs (i, j) where i < j.
Approach and Explanation 1:->
Count the number of 0s and 1s, then use combinatorial formulas to count valid pairs without enumerating them.
Formula used:
Pairs (1,1) = count1 * (count1 - 1) / 2
Pairs (0,1) = count0 * count1
Total answer = (1,1) pairs + (0,1) pairs.
TC->O(N)
SC-> O(1)
Approach and Explanation 2:->
Traverse the array once, maintain the count of 1s seen so far, and update the answer based on whether the current element is 0 or 1.
TC->O(N)
SC-> O(1)
![Jimmy8812840801's tweet photo. #DSA #BitManipulation
Problem:->Given a binary array (containing only 0 and 1), find the sum of A[i] | A[j] over all pairs (i, j) where i < j.
Approach and Explanation 1:->
Count the number of 0s and 1s, then use combinatorial formulas to count valid pairs without enumerating them.
Formula used:
Pairs (1,1) = count1 * (count1 - 1) / 2
Pairs (0,1) = count0 * count1
Total answer = (1,1) pairs + (0,1) pairs.
TC->O(N)
SC-> O(1)
Approach and Explanation 2:->
Traverse the array once, maintain the count of 1s seen so far, and update the answer based on whether the current element is 0 or 1.
TC->O(N)
SC-> O(1)](https://pbs.twimg.com/media/HJ3uWopacAAiTE4.jpg)
🚀Solved: Subarray AND Closest to K (@LeetCode - #Daily)
Maintain AND set per right endpoint (size ≤ log max). Update min diff.
⌛ O(n·log M) | O(log M)
🔥 #Day127/100
@CoderArmy #BitManipulation #Subarray #DSA26 #DAY127

🎉 Day 627 of @geeksforgeeks #POTD Challenge 🚀
Solved a problem using a neat bit manipulation observation: powers of 2 cannot be represented as a sum of consecutive positive integers, while all others can.
⚡ O(1) solution
#geeksforgeeks #DSA #BitManipulation #JavaScript

🚀 #Day 124/100 (Express as Consecutive Number Sum @GeeksforGeeks – #Daily)!
A number can be written as the sum of consecutive positive integers iff it is NOT a power of 2.
⌛O(1) | O(1)
✓ Accepted
@CoderArmy #100DaysOfCode #DSA #BitManipulation #Math #DSA26 #DAY124

🚀 Solved: Find if Array Can Be Sorted (@LeetCode Daily)
Group numbers by set bit count, track max per group. Ensure each group’s max is less than next group’s min.
⌛ O(n) | O(1)
🔥 #Day123/100
#DSA #BitManipulation #Greedy #Array #ProblemSolving @LeetCode #DSA26 #DAY123

🚀 #Day 123/100 (Replace with XOR of Adjacent @GeeksforGeeks – #Daily)!
Sweep left-to-right: keep original left neighbour, XOR with original right, update in‑place O(1) space.
⌛ O(n) | O(1)
✓ Accepted
@CoderArmy #100DaysOfCode #DSA #BitManipulation #Arrays #DSA26 #DAY123

🎉 Day 617 of @geeksforgeeks #POTD 🚀
Check All Set Bits
🔹 Approach 1: Checked every bit using modulo & division.
🔹 Approach 2: Used the optimized trick `(n & (n + 1)) === 0`.
#DSA #JavaScript #Coding #100DaysOfCode #BitManipulation

🚀 #Day 114/100 (Check if All Bits Set @GeeksforGeeks – #Daily)!
Key: (n & (n + 1)) == 0 for numbers with all bits set.
✓ O(1) | O(1)
✓ Accepted
@CoderArmy #100DaysOfCode #DSA #BitManipulation #DSA26 #DAY114

⚡📷Just uploaded a new coding video on Power of Four in C++! Learn how to efficiently check whether a number is a power of 4 using bit manipulation #PowerOfFour #CPP #CPlusPlus #Coding #Programming #DSA #CompetitiveProgramming #CodeNewbie #BitManipulation #LearnCoding
⚡📷Just uploaded a new coding video on Power of Three in C++! Learn how to efficiently check whether a number is a power of 3 using bit manipulation #PowerOfThree #CPP #CPlusPlus #Coding #Programming #DSA #CompetitiveProgramming #CodeNewbie #BitManipulation #LearnCoding
Day 129/365
Solved LeetCode Q1707 today.
Maximum XOR With an Element From Array.
Bitwise trie + offline queries — definitely not a straightforward one.
Learned a lot here.
#26meDSAkhatam #buildinpublic #LeetCode #bitmanipulation #trie

⚡💻Just uploaded a new coding video on Power of Two in C++!
Learn how to efficiently check whether a number is a power of 2 using bit manipulation
#PowerOfTwo #CPP #CPlusPlus #Coding #Programming #DSA #CompetitiveProgramming #CodeNewbie #BitManipulation #LearnCoding #Developer
• Solved LeetCode - Divide Two Integers ➗
• Practiced bit manipulation and edge case handling ⚡
• Improved problem-solving with math-based logic 🧠
#100DaysOfCode #Java #DSA #LeetCode #BitManipulation #CodingJourney

54. Number of 1 Bits
__builtin_popcount
55. Counting Bits
__builtin_popcount
56. Reverse Bits
go bit by bit, position as reverse
57. Missing Number
XOR idx/val/prev
58. Sum of Two Integers
calc carry, move carry to left, XOR
#DSA #BitManipulation #Math #Array
Can we explain this question how to solve it , type of solution single number iii #bitmanipulation #dsa #java

🚀 Back to Coding - @ali_In_bits
• Solved LeetCode - Single Number 🔍
• Used bitwise XOR for an optimal approach ⚡
• Improved understanding of binary operations 🧠
#100DaysOfCode #Java #DSA #LeetCode #BitManipulation #CodingJourney 💯

🚀#Day81/60 – #geekstreak60
Solved: Sum of XOR of all pairs (GFG)
For each bit: pairs = setBits × unsetBits, add pairs × 2^k.
📊Complexity:
✓O(n) | O(1)
✓ Accepted
Powered by @GeeksforGeeks & @NPCI_NPCI
#60DaysPOTD #geekstreak60 #npci #DSA #BitManipulation #XOR #DAY98/90!

Day 80 🚀
Solved a problem on checking whether a number is a binary palindrome on @geeksforgeeks colboration with @NPCI_NPCI
Used bit manipulation to reverse bits and compare with the original number.
#Day80 #DSA #BitManipulation #CodingJourney

🚀 #Day80/60 – #geekstreak60
Solved: Palindrome Binary (GFG)
Extract bits LSB to MSB. Two-pointer check for palindrome.
⌛O(log N) | O(log N)
✓ Accepted
Powered by @GeeksforGeeks & @NPCI_NPCI
#60DaysPOTD #geekstreak60 #npci #DSA #BitManipulation #Palindrome #DAY97/90

Last Seen Hashtags on Sotwe
ديوت_بدوي
Seen from Saudi Arabia
hoyimporta
Seen from Brazil
hijab porn
Seen from Germany
เย็ดหีหมา
Seen from Thailand
Victor_ray
Seen from Saudi Arabia
รับงานชัยนาท
Seen from Thailand
betterthanyapchik
เสียวหัว
Seen from Thailand
stepsis
Seen from United States
nolimit #nsfw #momson
Seen from United States
Trends for you
Most Popular Users

Elon Musk 
@elonmusk
240.1M followers

Barack Obama 
@barackobama
119.3M followers

Donald J. Trump 
@realdonaldtrump
111.6M followers

Cristiano Ronaldo 
@cristiano
108.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
97.2M followers

NASA 
@nasa
92.1M followers

Justin Bieber 
@justinbieber
90.5M followers

KATY PERRY 
@katyperry
86.7M followers

Taylor Swift 
@taylorswift13
80.5M followers

Lady Gaga 
@ladygaga
72.1M followers

Kim Kardashian 
@kimkardashian
69.3M followers

YouTube 
@youtube
68.6M followers

Virat Kohli 
@imvkohli
68.4M followers

Bill Gates 
@billgates
63.4M followers

The Ellen Show
@theellenshow
62.5M followers

CNN 
@cnn
61.9M followers

Neymar Jr 
@neymarjr
60.9M followers

X 
@x
60.9M followers

CNN Breaking News 
@cnnbrk
59.9M followers

![Jimmy8812840801's tweet photo. #DSA #BitManipulation
Problem:->Given a binary array (containing only 0 and 1), find the sum of A[i] | A[j] over all pairs (i, j) where i < j.
Approach and Explanation 1:->
Count the number of 0s and 1s, then use combinatorial formulas to count valid pairs without enumerating them.
Formula used:
Pairs (1,1) = count1 * (count1 - 1) / 2
Pairs (0,1) = count0 * count1
Total answer = (1,1) pairs + (0,1) pairs.
TC->O(N)
SC-> O(1)
Approach and Explanation 2:->
Traverse the array once, maintain the count of 1s seen so far, and update the answer based on whether the current element is 0 or 1.
TC->O(N)
SC-> O(1)](https://pbs.twimg.com/media/HJ3t06MaIAAQxXG.png)
























