I am confused as to why the LeetcodeLeetCode judge reports Memory Limit Exceeded when my solution looks close to the editorial solution. I not totoo familiar with @lru_cache@lru_cache and was using a memo dictionary at first that would take a tuple of index, and the sum of the subset. I change my code to see if that would make a difference, and it did not. With With this being said, I am not just having a problem with memory, I am also having a problem with runtime, this. This is leading me to believe that there's a problem with the algorithm itself. Understanding why I am having these complications would be greatly appreciated as I am in the early stages of learning backtracking + memo / dynamic programing.
Mentions -> The The find method is the one I created, while the dfs is the leetcode editorial for top-down approach. Also, feel free to comment on the structure or any opinionsfind method is the one I created, while dfs is the LeetCode editorial for top-down approach. Also, feel free to comment on the structure or any opinions.