3213. Construct String with Minimum Cost (Leetcode Hard)

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!
    Problem: leetcode.com/problems/constru...
    Twitch: / larryny
    Discord: / discord
    Instagram: / larrysomewhere
    #leetcode #coding #programming
  • Наука та технологія

КОМЕНТАРІ • 15

  • @Algorithmist
    @Algorithmist  27 днів тому

    Were you able to get the string here?

    • @himanshuvohra01
      @himanshuvohra01 26 днів тому

      yes..was able to solve all 4 in 54 mins. Seeing improvement and that's good sign.

  • @user-ub2ol5ou7e
    @user-ub2ol5ou7e 26 днів тому

    its feels good seeing you solve and explain at same time
    ...keep it up

  • @sagnikbiswas3268
    @sagnikbiswas3268 27 днів тому

    Slick DP

  • @julianelmasry9556
    @julianelmasry9556 23 дні тому

    lost on the TC

  • @ShubhamGhuleCode
    @ShubhamGhuleCode 26 днів тому

    I tried this question for almost 50mins but got tle on some test cases...I was using memoization using maps

  • @anmeluz
    @anmeluz 26 днів тому

    What is the 8 pointer prereq problem people are talking about?

    • @Algorithmist
      @Algorithmist  26 днів тому

      Variations of this problem exists on Leetcode, this one is a funky one

    • @anmeluz
      @anmeluz 26 днів тому

      @@Algorithmist My bad, I was thinking that '8 pointer' was a specific DP technique. I realize now the problem is worth 8 points which is why people are saying that.

  • @RedrixClaymore
    @RedrixClaymore 26 днів тому

    Isn't it still O(N^2) from the DP part?

    • @Algorithmist
      @Algorithmist  26 днів тому

      It is, this problem is full of issues

    • @user-ih9tu1kn7i
      @user-ih9tu1kn7i 17 днів тому

      I posted solution with N*SQRT(N) with KMP + Trie + DP, but people says Aho-Corasick need to be used.

  • @rafeeqm
    @rafeeqm 16 днів тому

    TLE

  • @lesliechiu1437
    @lesliechiu1437 27 днів тому

    Useless