Leetcode Weekly Contest 405 | Video Solutions - A to D | by Harsh Gupta | TLE Eliminators

Поділитися
Вставка
  • Опубліковано 11 жов 2024

КОМЕНТАРІ •

  • @TLE_Eliminators
    @TLE_Eliminators  3 місяці тому

    Please fill the feedback form: forms.gle/52XsaRWXd2P4pBqz5

  • @sdeBack1
    @sdeBack1 3 місяці тому +2

    We can further optimize. Instead of storing index, we can store cost .Each time when we end at same char we store min cost

  • @virujthakur9260
    @virujthakur9260 3 місяці тому +4

    Isn't the code's complexity isn't N^2 in worst case? How does it pass the constraints?

  • @gigachad2419
    @gigachad2419 3 місяці тому +5

    Trie+DP fails few testcases within constraints.
    Was expecting Rolling Hash+DP solution.

  • @ronitkumarbaranwal6844
    @ronitkumarbaranwal6844 3 місяці тому

    Truly helpful !!

  • @apnachannelnitp1833
    @apnachannelnitp1833 2 місяці тому

    solution of question 4 will give TLE.

  • @inspirationalshorts2689
    @inspirationalshorts2689 3 місяці тому +1

    About question 4 their is not any another way to solve without using Trie because in my first instance it will seem familiar of recursion + memoization of pick or notPick because ultimately we have to calculate minimum cost to formed target string by using substring matching way on recursion by taking start index? Everyone only talking about using Trie to solve this question that's mean their is no another way left to solve this question.

    • @AMITKUMAR-sz4fg
      @AMITKUMAR-sz4fg 3 місяці тому +2

      give a try using rolling hash

    • @inspirationalshorts2689
      @inspirationalshorts2689 3 місяці тому +1

      @@AMITKUMAR-sz4fg Can you elaborate more about rolling hash to solve this problem it will be more beneficial.

    • @Cools74
      @Cools74 3 місяці тому

      ​@@inspirationalshorts2689
      Refer Coding mohan channel
      He explained using rolling hash

  • @atanunayak6637
    @atanunayak6637 3 місяці тому

    Well explained!

  • @arijoymajumdar2326
    @arijoymajumdar2326 3 місяці тому

    Very helpful!