1442. Count Triplets That Can Form Two Arrays of Equal XOR | Bit Manipulation | 5 Ways | XOR TRICKS

Sdílet
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

Komentáře • 27

  • @ARYANMITTAL
    @ARYANMITTAL  Před měsícem +5

    TCS to Google | How to Grab Offcampus Opportunities - czcams.com/video/YFqoeAxiRpE/video.html

  • @arpanbanerjee6224
    @arpanbanerjee6224 Před měsícem

    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!

  • @paras6079
    @paras6079 Před měsícem

    You are Too Good, 👌
    Thank u so much.

  • @kandariarjun
    @kandariarjun Před měsícem +1

    Bro prefix sum ki playlist banao pls..btw nice explanation

  • @blazedoodle3842
    @blazedoodle3842 Před měsícem

    great explanation , liked the way you keep the explanation crisp and straightforward , keep it up

  • @mukulkhanna26
    @mukulkhanna26 Před měsícem

    best solution entire planet🤘🤘🤘🤘

  • @zebra-er6xc
    @zebra-er6xc Před měsícem

    aryan cs fundamentals kaise aur kaha se karne chahiye? for placements, make a video on this please

  • @UECAshutoshKumar
    @UECAshutoshKumar Před měsícem

    thank you

  • @nagasrisaichaitanyakolluri8173

    Great explanation bro

  • @abdurrouf4159
    @abdurrouf4159 Před měsícem

    Superb

  • @RajatSingh-xu6to
    @RajatSingh-xu6to Před měsícem +1

    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

  • @nptel1punith929
    @nptel1punith929 Před měsícem +1

    Explanation 📈📈

  • @zebra-er6xc
    @zebra-er6xc Před měsícem

    thanks for the O(n) solution

  • @coderunner743
    @coderunner743 Před měsícem

    super bro

  • @amanmangukiya9928
    @amanmangukiya9928 Před měsícem

    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

  • @AP-vo7gp
    @AP-vo7gp Před měsícem

    Hi Aryan , can u please help me with today's gfg potd !

  • @ChiruBillion
    @ChiruBillion Před měsícem

    bhai aaj video ayegi?? leetcode contest ke solutions ki??

  • @user-iz5gb1zt3e
    @user-iz5gb1zt3e Před měsícem +1

    Bro can you do a video on segment tree and fenwick tree please

    • @ARYANMITTAL
      @ARYANMITTAL  Před měsícem

      Segment Tree Crash Course Coming tomorrow on CodeWithAryan channel

    • @user-iz5gb1zt3e
      @user-iz5gb1zt3e Před měsícem

      @@ARYANMITTAL
      Thanks a lot bro❤❤

  • @aizad786iqbal
    @aizad786iqbal Před měsícem

    Approach 2-- why j is taken from i+1?

  • @Robinkumar-ew9ky
    @Robinkumar-ew9ky Před měsícem

    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(😂😂😂🤣)

  • @Engineering.Wallah
    @Engineering.Wallah Před měsícem

    17:31 thanks bro
    Coder

  • @Engineering.Wallah
    @Engineering.Wallah Před měsícem

    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