It is more than sufficient. The max value for r can be 1e14 though. And binary search is fast enough to not make that much of a difference in running time.
@@rohit2571 for every triplet (i,j,k) there is (j,i,k) XORing both will result to 0 so all triplets get cancelled out except those like (i,i,i) (a[i]|a[i])&a[i]=a[i] itself So XORing every element will give the answer.
Hahahaha, I had also done the same mistake on problem A, In every 3 to 4 contests Overflow makes it's presence felt in leetcode 😂😂
Without thinking the logic of xor beauty prob, I took xor of all value and that was correct.
At 29:30 I was stuck on the same problem and tried using segment tree with lazy propagation to update the sun for the range and it TLEd
can you please make a dedicated video on the last problem I cannot comprehend it
A to C felt too easy, but D was tough. Thanks for the consistency Sir🙏🙏
Not able to solve B :(
Why you initialized 'r' to 1e18 in line no 24?
It is more than sufficient. The max value for r can be 1e14 though. And binary search is fast enough to not make that much of a difference in running time.
My C solution:
class Solution {
public:
int xorBeauty(vector& nums) {
int xoor = 0;
for(auto it: nums) xoor ^= it;
return xoor;
}
};
what's the approach brother??
@@rohit2571 for every triplet (i,j,k) there is (j,i,k) XORing both will result to 0 so all triplets get cancelled out except those like (i,i,i) (a[i]|a[i])&a[i]=a[i] itself
So XORing every element will give the answer.
can you share that icpc prep sheet that is bookmarked please?
hey , how can i become expert on codeforces in a time like 3-4 months. or is this impossible or far away from reality
You got a under 500 rank I suppose
It was not updated when you saw rank
I got around 560 and my finish time was 7 mins more than you
That's why
Congrats bro
@@noobnessmee Thanks
nice
What happened to your hairline??
Getting this integer overflow error is quite irritating 🥲🥲