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.
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
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?
How many subsequences were you able to find?
Thanks for solving this! This was pretty tricky for me.
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.
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.
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
Thanks
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?
I mean, there's a countdown clock, just wait for it haha
@Algorithmist I see thanks you
why do keeping dp outside class works in lesser time?
Cuz it reinitializes every test case otherwise
@@zanies6288it reinitializes anyway
It's silly, and it should not be a thing, but it is, so
The insight to focus on max and THEN focus on min was very clever. Is the math.comb function too slow to use here?
possibly - because it is calculated without MOD, it can have many digits, didn't think it was worth testing!