Java Anagrams Hackerrank Solution in Hindi

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

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

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

    Thanks bro it was confusing at the start but u exampled it very well🥰

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

    New Approach buddy .

  • @chandhukyasa8836
    @chandhukyasa8836 3 года назад +3

    Brother good code but i have small doubt at index . Can you explain that some more clearly there ... ?

    • @techpathak3617
      @techpathak3617  3 года назад +3

      Yes in the index we are getting index value like c is the 3 alphabet of English so we will store it on the 3rd index and if we are getting same in the 2nd string then we will do minus then if it will become 0 it means both are other both are different if both are different then it's not anagram.
      I hope you will get some clarity with this.

  • @Nick-and-Boys
    @Nick-and-Boys 2 года назад

    thanks for the effort !
    🥰

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

    good work.

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

    Bro in a test case it is showing that index out of bounds

  • @anujpratap4743
    @anujpratap4743 5 месяцев назад

    a kyu add kyu?

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

    isse achha to string to array mein convert karo fir sort kar k every element compare karo

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

    Why charAt(i)-a???

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

      Here charAt(i)-'a' will give you the correct position like in alphabet a comes on 1st position so it will give us 1

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

      @@techpathak3617 mai ni smjhi 'a' q minus kara...mtlb 'a' hi q and aap bole c-a krenge to 3 mil jaega mtlb?

    • @techpathak3617
      @techpathak3617  3 года назад +6

      @Pragya Parmar
      Here the ASCII value of a is 97 and so when you will do charAt(i)-'a' then it will give you the correct position of any character.
      E.g. suppose charAt(i) is give m so
      m-a here ASCII value of m is 109 and ASCII value of is 97 so 109-97= 12 which is the correct index of m according to alphabet.
      I hope you are able to understand now.

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

      @@techpathak3617 haa mai smjh gyi
      Thank you so much ❤️

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

      @@techpathak3617 actually m in 13th position and your ans is 12th