Extra Characters in a String - Leetcode 2707 - Python

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 18

  • @UmarKhan-rb3ts
    @UmarKhan-rb3ts Před rokem

    The way I went about doing it is the same dp memoisation approach but instead of creating all possible substrings of the string starting the ith index, I iterated over the dictionary words and took the subtring of the given string starting ith index exactly the same length as each dictionary word. However,I don't think there is a great difference in time complexity.

  • @poojababa67
    @poojababa67 Před rokem +1

    The explanation is as neet(neat) as it could get!

  • @rajrajesh1669
    @rajrajesh1669 Před 11 měsíci +1

    Nice explanation

  • @MP-ny3ep
    @MP-ny3ep Před rokem +1

    Great Explanation !

  • @chien-yucode992
    @chien-yucode992 Před 9 měsíci +1

    YOU ARE AWESOME

  • @soumyajitchatterjee5822

    Damn. This was a really great solution.

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

    I really doubt if these companies will continue to select candidates based on their leetcode coding performance in the future.

  • @light_70
    @light_70 Před rokem +1

    Thanks :)

  • @berserk.4121
    @berserk.4121 Před rokem

    What kind of app(board) he uses to draw

  • @abdulrhmankhattab9041

    ty

  • @swastikgorai2332
    @swastikgorai2332 Před rokem +1

    can we do it like word break??

  • @Rancha51
    @Rancha51 Před rokem

    Can you please do Odd Even Jump ? been waiting for that a long time now

    • @Nisha.......
      @Nisha....... Před rokem

      problem number?

    • @Rancha51
      @Rancha51 Před rokem +1

      @@Nisha....... Leetcode 975

    • @Nisha.......
      @Nisha....... Před rokem +1

      @@Rancha51
      Just tried it using DP, here's the solution:
      class Solution:
      def oddEvenJumps(self, arr: List[int]) -> int:
      n=len(arr)
      x=[[False,False] for i in range(n)]
      # odd, even
      # set both even jump and odd jump of last element to true
      x[-1][0]=True
      x[-1][1]=True
      for i in range(n-2,-1,-1):
      cur1=[inf,inf]
      cur2=[-inf,inf]
      for j in range(i+1,n):
      if arr[j]>=arr[i] and arr[j]

    • @Rancha51
      @Rancha51 Před rokem +2

      @@Nisha....... Thanks for the effort, appreciate it. But I am looking for explanation not the code.

  • @ahmedashraf3199
    @ahmedashraf3199 Před rokem

    could u consider a c++ solution next time ? ty alot.