Shifting Letters II | Leetcode 2381

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

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

  • @BhargavaShankar-gu8gh
    @BhargavaShankar-gu8gh 16 дней назад +6

    Great video, Learnt about difference array from your channel to solve this problem!!!

  • @rahulsbhatt
    @rahulsbhatt 16 дней назад +3

    Thank you so much for teaching this technique sir!

  • @saikrishna872
    @saikrishna872 16 дней назад +3

    New pattern nice to remember Thank you very much for the efforts. I always jump into yours as 1st preference.

    • @techdose4u
      @techdose4u  16 дней назад +1

      Thanks for the support! 😄

  • @programming6177
    @programming6177 16 дней назад

    Thank you bro. you are great, i learned lot of new things from you 😇😇Love you brother

    • @techdose4u
      @techdose4u  16 дней назад

      Thanks for the love! 😄

  • @PriyanshuSarkar-y9k
    @PriyanshuSarkar-y9k 16 дней назад

    Both videos are well explained thank you this pattern stick to my head.

    • @techdose4u
      @techdose4u  16 дней назад

      Glad you found it helpful!

  • @divyasingh6771
    @divyasingh6771 16 дней назад

    Thank you sir !

  • @shivamshrey47
    @shivamshrey47 16 дней назад

    count = diff[i] % 26 will not result in a negative value as I understand. So is the condition if count < 0 required?
    -2 % 26 = 24 > 0
    2 % 26 = 2 > 0
    So it seems this will never be negative.
    My submission without the condition was also accepted.

    • @techdose4u
      @techdose4u  16 дней назад

      It may be language dependent.
      In your languague & version it would work as you said.
      But may not be true for all :)

  • @harsha8173
    @harsha8173 16 дней назад

    Excellent Explaination

  • @venkatanarendranalamothu3649
    @venkatanarendranalamothu3649 15 дней назад

    thanks sir

  • @manoj01
    @manoj01 16 дней назад

    (k%26) + 26 is always equal to (k%26) when we use %26 again right? I can't understand this for decrement can any one explain? for negative values like -2 , -2 mod 26 is 24 right we are adding 26 to it and again we are doing mod operation at last which is same as 24 right? I am a bit confused here

    • @vkireetichandan747
      @vkireetichandan747 16 дней назад +1

      In java /C++
      -2%26 is not 24 its actually -2 so, 2 steps backward equals to 24 steps forward
      In python
      -2%26 returns 24 , In python it actually returns correctly.
      So In java / C++
      1)-2%26 = -2
      2)-2+26 = 24
      3)24%26 = 24 =>same
      In python
      1)-2%26 = 24
      2)24 + 26 = 50
      3)50%26 = 24 =>same
      Here is the reason

    • @manoj01
      @manoj01 16 дней назад

      @vkireetichandan747 oh thanks I thought the above is for all languages now I get it

  • @shashishekhar----
    @shashishekhar---- 16 дней назад

    Great Video , Thanks.

  • @Carryout-w4f
    @Carryout-w4f 16 дней назад

    can you share me the link to understand difference array concept?

    • @techdose4u
      @techdose4u  16 дней назад

      It is in the description and also in i button in top right

  • @LinhHoang-ml1qo
    @LinhHoang-ml1qo 16 дней назад

    Hi teacher, thank a lots for your explanation.I have a bit confuse a bout diff array: In the Difference array video below, you give an example a bout stock array and you said that we have compute the difference between the ith element and (i-1)th element.There is nothing to wonder in Difference array problem because all of element is equal zero, so we can initial a zero array.But in this problem, every character have difference ascii code, so i wonder why you initial array contains all zero instead of difference between their ascii code?Please explain clearly for me.Have a good day

    • @techdose4u
      @techdose4u  16 дней назад

      You can start with all 0s and just record increase & decrease so that at the end, You can just review the gradient and get the actual increment.
      I think ASCII was not recorded when diff array was defined.
      The default is 0

  • @sailendrachettri8521
    @sailendrachettri8521 16 дней назад

    Thank you sir :)

  • @shashishekhar----
    @shashishekhar---- 16 дней назад

    Just a suggestion, try to also give solutions in Python, a lot more viewers will be interested, Thanks.

    • @techdose4u
      @techdose4u  16 дней назад +1

      Solutions are added in Python too along with CPP & JAVA

  • @alonerider4191
    @alonerider4191 16 дней назад

    10:20 why incremented by +1

    • @techdose4u
      @techdose4u  16 дней назад

      Thats the logic of Range update.
      Please watch difference array video again.
      We are decrementing hence we add.
      if we increment then we subtract.

  • @another-day-2024
    @another-day-2024 16 дней назад +1

    Bro I am a regular viewer of your content, and unfortunately too many ads show up during the entire video. Too much ad creates distraction....

  • @priyanshugangwar7472
    @priyanshugangwar7472 16 дней назад

    Sir ye code toh chal hi nhi rha h

  • @varadpanchal1231
    @varadpanchal1231 16 дней назад

    gives the wrong answer check your solution

    • @techdose4u
      @techdose4u  16 дней назад

      Sometimes languague conversion creates some glitch in other languagues.

  • @yatri6329
    @yatri6329 16 дней назад

    z hota h G nhi, please yaar aur complicate mat kr ye sb bol k

    • @techdose4u
      @techdose4u  16 дней назад

      its translated as Zee in american english.
      couldnt keep track of countrywise english if you don’t mind :)