3045. Count Prefix and Suffix Pairs II | Weekly Leetcode 385

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 17

  • @raviteja8882
    @raviteja8882 11 หลายเดือนก่อน +1

    The way you started by breraking down the time complexity and tried optimizing the sub parts is simply amazing

  • @sukritiguin5637
    @sukritiguin5637 11 หลายเดือนก่อน +1

    You are a great teacher. Out support is always with you. ❤❤

  • @SlateCode
    @SlateCode 11 หลายเดือนก่อน

    Understood

  • @rohanthakur9159
    @rohanthakur9159 11 หลายเดือนก่อน +1

    Thanks a lot for the detailed explanation sir.

  • @Cools74
    @Cools74 11 หลายเดือนก่อน +1

    Thanks

  • @varungudamsetti449
    @varungudamsetti449 11 หลายเดือนก่อน

    Hi mohan. If I divide p_pwr[i] with a hash (instead of multiplying it on the other side), I get the wrong answer. What to do in the case where we don't have a choice of multiplying on the other side of eq. ? I am trying to use this hashing technique in "Repeated DNA Sequences" where there is no comparison of hash values (to multiply and compare). BTW, you are a great teacher. Thank you.

    • @codingmohan
      @codingmohan  11 หลายเดือนก่อน

      Division has to be with modulus. You have to use Fermat little theorem to convert division into multiplication first.
      If you are doing this already then there must be some bug in your code. The easiest way to try is to divide any number (say 5) by same number and see whether your code gives 1 as output or not.
      If you are still stuck, feel free to paste your code and I am happy to help you debug.

    • @varungudamsetti449
      @varungudamsetti449 11 หลายเดือนก่อน

      @@codingmohan could you please do a video on Fermit Little theorem? Thank you.

    • @codingmohan
      @codingmohan  11 หลายเดือนก่อน

      There are already few videos where I explained the theorem from scratch, try searching once (away from laptop now). If you don't find, let me know and I will try to find the link.

    • @varungudamsetti449
      @varungudamsetti449 11 หลายเดือนก่อน

      @@codingmohan I searched for "Fermat's little theorem by Coding Mohan". Nothing came. Please share the link if possible. Thank you.

    • @codingmohan
      @codingmohan  11 หลายเดือนก่อน

      th-cam.com/video/QB-X1ZJW-kE/w-d-xo.html

  • @anshulsharma3137
    @anshulsharma3137 11 หลายเดือนก่อน +2

    Excellent explanation bro 🔥🔥🔥 Btw what will be the codeforces rating for this question?

    • @deepakpatre172
      @deepakpatre172 11 หลายเดือนก่อน

      I guess 1200-1400

  • @iWontFakeIt
    @iWontFakeIt 11 หลายเดือนก่อน

    hello, why you use name mohan when your name is subham ?
    also i am junior from your college; i came to know today itself man!

    • @codingmohan
      @codingmohan  11 หลายเดือนก่อน +1

      I just like the name Mohan and a friend of mine suggested this randomly and I didn't think again :)

    • @iWontFakeIt
      @iWontFakeIt 11 หลายเดือนก่อน

      ​@@codingmohannice man!