摘要:
Recursion of course. But please make sure you cover all the cases. class Solution(object): # return: max value with node picked, max val w\o node pick 阅读全文
摘要:
Backtrace idea is straightforward. But there are always smarter solutions - like this: https://leetcode.com/discuss/87314/non-recursive-time-space-sol 阅读全文