Valid Anagram | Leetcode 242 | Explanation and solution in C++

Sdílet
Vložit
  • čas přidán 15. 03. 2021
  • Hey everyone, here I have discussed the Q. 242 of leetcode with code in C++.
    Connect with me:
    Instagram : / i_m_sarvesh__
    LinkedIn : / sarvesh-roshan-1429b3158
    Github : github.com/imroshan12

Komentáře • 8

  • @anupamagrawal524
    @anupamagrawal524 Před rokem

    great and very simple to understand, thank you

  • @gamingwithkode2213
    @gamingwithkode2213 Před 11 měsíci

    good one!!👍

  • @TheDima23
    @TheDima23 Před rokem

    nice, thank you !

  • @nskkknagajayanth1199
    @nskkknagajayanth1199 Před rokem

    code explanation was nice and effective.

  • @adityapatil1839
    @adityapatil1839 Před rokem +6

    bool isAnagram(string s, string t) {
    sort(s.begin() , s.end()) ;
    sort(t.begin(), t.end());
    if(s==t){
    return true;
    }
    return false;
    }

    • @programmer6548
      @programmer6548 Před 7 měsíci

      The one in the video is more efficient, I think, Also you can just return s==t;

    • @GaganSingh-zz9el
      @GaganSingh-zz9el Před 24 dny

      @@programmer6548 yes , but the code he provided gives out logn time complexity due to sorting but the code in the video is the optimal code.

  • @1912harshit
    @1912harshit Před 2 lety

    good explanation