摘要: 题一: 提交:层序遍历bfs O(N) O(N) class Solution: def levelOrder(self, root: TreeNode) -> List[int]: if not root : return [] queue = [root] res = [] while queu 阅读全文
posted @ 2020-04-23 21:40 oldby 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 方法:动态规划 完全背包问题 class Solution: def waysToChange(self, n: int) -> int: coins = [1,5,10,25] dp = [0] * (n+1) dp[0] = 1 for coin in coins: for i in 阅读全文
posted @ 2020-04-23 20:25 oldby 阅读(171) 评论(0) 推荐(0) 编辑