1442. Count Triplets That Can Form Two Arrays of Equal XOR | Bit Manipulation | 5 Ways | XOR TRICKS
Vložit
- čas přidán 23. 07. 2024
- In this video, I'll talk about how to solve Leetcode 1442. Count Triplets That Can Form Two Arrays of Equal XOR | Bit Manipulation | 5 Ways | XOR TRICKS
Bit Manipulation Crash Course - • BIT MANIPULATION Crash...
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
0:00 - Problem Explanation
1:26 - Approach 1 - O(n^4)
2:42 - Approach 2 - O(n^3)
4:38 - Approach 3 - O(n^2)
14:20 - Approach 4 - O(n) Two Pass
19:35 - Approach 5 - O(n) One Pass
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms
TCS to Google | How to Grab Offcampus Opportunities - czcams.com/video/YFqoeAxiRpE/video.html
This is the best explanation! Clearly explained how to optimised the solution going one step at a time, building up on the brute force solution. Awesome!
You are Too Good, 👌
Thank u so much.
Bro prefix sum ki playlist banao pls..btw nice explanation
great explanation , liked the way you keep the explanation crisp and straightforward , keep it up
best solution entire planet🤘🤘🤘🤘
aryan cs fundamentals kaise aur kaha se karne chahiye? for placements, make a video on this please
thank you
Great explanation bro
Superb
In third approach it can be done even without using prefix XOR.
class Solution {
public int countTriplets(int[] arr) {
int n=arr.length;
int cnt=0;
int a=0;
for(int i=0;i
Explanation 📈📈
thanks for the O(n) solution
super bro
there should be prefix[i-1]==prefix[k] because of xor from i to k is zero it means that xor up to i-1 == xor upto k
Hi Aryan , can u please help me with today's gfg potd !
bhai aaj video ayegi?? leetcode contest ke solutions ki??
Bro can you do a video on segment tree and fenwick tree please
Segment Tree Crash Course Coming tomorrow on CodeWithAryan channel
@@ARYANMITTAL
Thanks a lot bro❤❤
Approach 2-- why j is taken from i+1?
In java I have submitted code with your approach 4th and 5th (n square and n) .
Code with n square is running in 1ms and with n time complexity is running in 2ms .
Leetcode(😂😂😂🤣)
17:31 thanks bro
Coder
Can you pls tell the time complexity of following approach:
(Please)
class Solution {
public: int countTriplets(vector& arr) {
unordered_mapmp; //xor,index
mp[0].push_back(0);
int n=arr.size(),Xor=0,ans=0;
for(int i=0;i1){
for(int i=0;i
Ye approach best h kya?
It's similar to longest subarray with sum k
It is O(n^2) sir 🙌🏻
@@ARYANMITTAL I thought it's O(N³) in worst case