sir, i tried this valentine magic ques using TOP-DOWN DP and on submitting this i’m getting TLE
but when i see the EDITORIAL approach
they have used the same way(obviously there is only 1 way and they use the same top down DP approach but in C++)
and i’m doing on python
so i don’t why i’m getting TLE and editorialist code is getting all test cases passed inspite of doing the ques in same way.