@@NarayanGupta-t9s original array nikalna muskil hai, because 0 ke liye original me 0 0 ya 1 1 hoga and 1 ke liye original me 0 1 ya 1 0 hoga. Maine socha tha ye but possible ni laga..
sir, you are doing good work, I love your explanations. Please don't listen to people who do not understand how things work, don't answer them, just ask them to pay you monthly so that you can pay out expenses of running a youtube channel. I read some comments and they were very demeaning. I respect you a lot and I am happy that I have been following you and it has been really very helpful. Running an edtech channel is no joke. I would also suggest running paid batches that provide live interaction for students who have doubts and can ask immediately.
Even number of 1s? In this video I have explained that if condition is met then all elements will appear twice and cancel out it each other.. it is given in question ( d[i] = orig[i] xor orig[i+1]).
class Solution { public boolean doesValidArrayExist(int[] derived) { int n = derived.length; int ans =0; for(int i:derived){ ans ^=i; } if(ans==0){ return true; } return false; } }
like target for this video is 150. Please do like if you have understood the explanation as well as the code.😄
Your teaching style is so impressive. Believe me I am saying this with very responsiblities.👏👏👏
🙌
res=0
for nums in derived:
res^=nums
return (res==0)
python
Thanks..Nice explanation..Similar to last day
Yup!
tagda bhai maine original array ikalne ke liye n**2 me try kiya nhi hua but tumhare waliapproch se 2 min me ho gya thank brother
@@NarayanGupta-t9s original array nikalna muskil hai, because 0 ke liye original me 0 0 ya 1 1 hoga and 1 ke liye original me 0 1 ya 1 0 hoga. Maine socha tha ye but possible ni laga..
nice explanation bhaiya
sir, you are doing good work, I love your explanations. Please don't listen to people who do not understand how things work, don't answer them, just ask them to pay you monthly so that you can pay out expenses of running a youtube channel. I read some comments and they were very demeaning. I respect you a lot and I am happy that I have been following you and it has been really very helpful. Running an edtech channel is no joke. I would also suggest running paid batches that provide live interaction for students who have doubts and can ask immediately.
not everyone understands and its okay. This is one of the reasons I have disabled dms on my social platforms...
I solved this question and also the previous one daily leetcode challenge .
@@tanmayanand5489 💯💯
Target is completed ❤
🙌💯🚀
150th like is mine 😅🎉 seriously
✨️🙌🙌
what do you use to draw on screen?
Hi sir, could you please explain why having an even number of 1s in the derived array is considered a sufficient condition?
Even number of 1s? In this video I have explained that if condition is met then all elements will appear twice and cancel out it each other.. it is given in question ( d[i] = orig[i] xor orig[i+1]).
class Solution {
public boolean doesValidArrayExist(int[] derived) {
int n = derived.length;
int ans =0;
for(int i:derived){
ans ^=i;
}
if(ans==0){
return true;
}
return false;
}
}
@@opkrchauhan_1 💯💯
At last instead of if block use can directly use
return ans==0