3428. Maximum and Minimum Sums of at Most Size K Subsequences (Leetcode Medium)

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

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

  • @Algorithmist
    @Algorithmist  7 วันที่ผ่านมา

    How many subsequences were you able to find?

  • @jamesperaltaSWE
    @jamesperaltaSWE วันที่ผ่านมา

    Thanks for solving this! This was pretty tricky for me.

  • @zweitekonto9654
    @zweitekonto9654 6 วันที่ผ่านมา +1

    Didn't know leetcode could pull a codeforces like that. While I spent my entire time trying to figure out how do I memoize my take not take dp LMAO.

  • @pankaj.vishw.1011
    @pankaj.vishw.1011 6 วันที่ผ่านมา

    Is it possible to solve this problem without knowing the math required (without brute force approach). I am new to dsa and wants to be good in it and I don't have good base of math , do i have to cover some math concepts for advance level dsa? if yes can you note down some concepts which is essential for dsa.

    • @Algorithmist
      @Algorithmist  6 วันที่ผ่านมา

      No, I think this is basically maths and counting, though maybe there's another way of doing it, this is probably the simplest.. assuming you have the prerequisites

  • @cursed_nerd
    @cursed_nerd 5 วันที่ผ่านมา

    Thanks

  • @SandeepWithAI
    @SandeepWithAI 6 วันที่ผ่านมา

    i dont understand how these weekly contest work, it says it starts at some point in time..and when i come at that point it is ended already can anyone explan what hapenning in leetcode?

    • @Algorithmist
      @Algorithmist  6 วันที่ผ่านมา +2

      I mean, there's a countdown clock, just wait for it haha

    • @SandeepWithAI
      @SandeepWithAI 6 วันที่ผ่านมา

      @Algorithmist I see thanks you

  • @VarshilNarola
    @VarshilNarola 6 วันที่ผ่านมา

    why do keeping dp outside class works in lesser time?

    • @zanies6288
      @zanies6288 6 วันที่ผ่านมา

      Cuz it reinitializes every test case otherwise

    • @De1n1ol
      @De1n1ol 6 วันที่ผ่านมา

      @@zanies6288it reinitializes anyway

    • @Algorithmist
      @Algorithmist  6 วันที่ผ่านมา

      It's silly, and it should not be a thing, but it is, so

  • @ccolombe
    @ccolombe 7 วันที่ผ่านมา

    The insight to focus on max and THEN focus on min was very clever. Is the math.comb function too slow to use here?

    • @Algorithmist
      @Algorithmist  7 วันที่ผ่านมา +1

      possibly - because it is calculated without MOD, it can have many digits, didn't think it was worth testing!