By sheer brute of force! Leetcode Weekly Contest 403 (54th) with commentary

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

КОМЕНТАРІ • 7

  • @Algorithmist
    @Algorithmist  2 місяці тому +1

    How did you do this contest?

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

      Got 3 during the contest, solved #4 within 10 min after the contest

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

      I was never there 👻😶‍🌫️

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

    i felt you on the first question, i gave this contests 30 minutes after waking up from a 5 hour sleep and for the first 2 minutes i could not understand what the first question wanted from me lol

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

    Can’t believe it. I solved 3 using recursive dp just doing nums[i] * state + dp(i+1, state * -1) and the other is nums[i] + dp(i+1, -1). Then take best of the two and return best; cache the function as well. I was scrolling through the other solutions in the ranking page and I was like how did no one else do this? Then I realised this is probably not very efficient.😂

  • @user-vs3jn4xi4x
    @user-vs3jn4xi4x 2 місяці тому +1

    couldn't do 3
    came here for solution

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

      I still have unsolved problems from last year😂 should probably get round to those