HackerRank - Making Anagrams | Full Solution with Simplified Examples and Visuals | Study Algorithms

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 33

  • @063harshsahu2
    @063harshsahu2 Год назад

    You make it Simple, In this World their are very few people who make things easy You are one of them,

    • @nikoo28
      @nikoo28  Год назад

      thank you so much

  • @Ahmed_Salah00
    @Ahmed_Salah00 Год назад +1

    bro I'm speechless! perfect!!

    • @nikoo28
      @nikoo28  Год назад

      Thank you so much 😀

  • @BabyKrishna01
    @BabyKrishna01 Год назад

    Concept is clear with the video, please explain the program itself as well, why you are taking int c array or like thi

    • @nikoo28
      @nikoo28  Год назад

      the solution explains why we need the array. :) do you have a specific doubt? i can help

  • @vikrantkambli9265
    @vikrantkambli9265 2 года назад

    your explanation is crystal clear..thank you so much bro..

    • @nikoo28
      @nikoo28  2 года назад

      So nice of you

  • @deepika8401
    @deepika8401 3 года назад +1

    I am able to solve problems because of you

  • @maheshguttedar3620
    @maheshguttedar3620 2 года назад +1

    Very detailed explanation.

  • @manishkawale4037
    @manishkawale4037 Год назад +1

    Great Explanation.

  • @Philthyyy
    @Philthyyy 3 года назад

    Very detailed explanation. Thank you for your time and insight.

  • @92akky
    @92akky Год назад

    Nice explanation

    • @nikoo28
      @nikoo28  Год назад +1

      Thanks and welcome

  • @davidlazaro3143
    @davidlazaro3143 2 года назад

    What an amazing video 🥰

  • @rajakabdul6407
    @rajakabdul6407 8 месяцев назад +1

    Hae bro
    Can u explain
    What is Math.abs(i)

    • @nikoo28
      @nikoo28  8 месяцев назад

      it gets the absolute value.
      Example:
      Math.abs(-1) = 1
      Math.abs(1) = 1

  • @rmukeshverma8724
    @rmukeshverma8724 Год назад

    int n1{s1.size()};
    int n2{s2.size()};
    int result{};
    vector sr1(26);
    vector sr2(26);

    for(int i=0; i < n1; ++i)
    {
    sr1[abs('a'-s1[i])] +=1;
    }

    for(int i=0; i < n2; ++i)
    {
    sr2[abs('a'-s2[i])] +=1;
    }


    for(int i = 0; i < 26; ++i)
    {
    result += abs(sr2[i]-sr1[i]);

    }
    return result;
    why it's incorrect?

  • @stonedcodingtom9097
    @stonedcodingtom9097 2 года назад

    Great video

  • @vandanabanny7550
    @vandanabanny7550 2 года назад

    excellent thank you :)

  • @tamdaominh1802
    @tamdaominh1802 3 года назад

    Thanks

  • @taherkp7321
    @taherkp7321 3 года назад

    Hi. Just a question here, why are doing (s1.char(i) - 'a' ) here? what is the significance of 'a'. Thanks

    • @nikoo28
      @nikoo28  3 года назад +1

      We want to index each character in alphabet. So ‘a’ = 0, ‘b’ = 1, ‘c’ = 2, ‘d’ = 3…and so on.
      With this statement we calculate this index. If charAt(i) is ‘a’ then we will get ‘a’ - ‘a’ = 0.
      This position is now used in array.
      If charAt(i) = ‘k’. Then ‘k’ - ‘a’ = 10
      We get position 10 of array.
      Does this clear your doubt?

    • @taherkp7321
      @taherkp7321 3 года назад

      @@nikoo28 Yes.. Thanks

  • @Grammar-EN
    @Grammar-EN Год назад

    bro in which language u explained

  • @pratyakshamaheshwari8269
    @pratyakshamaheshwari8269 3 года назад

    int makeAnagram(string a, string b) {
    int *c = new int(26);
    for(int i=0;i

    • @kirannaik4417
      @kirannaik4417 Год назад

      total = total + abs(c[i]) ;
      I think you had found the mistake..

    • @VishalEdu03
      @VishalEdu03 10 месяцев назад

      .c[s1.charAt(i) - 'a '] ++ ..anyone can explain using for loop ...

  • @MohdAshraf-nw9bz
    @MohdAshraf-nw9bz 2 месяца назад

    HashMap hm= new HashMap();
    for(int i=0; i