摘要: Relational Database Services manage DB using SQL allow you to create databases in the cloud that are managed by aws Postgres, MySQL, Maria DB, Oracle, 阅读全文
posted @ 2024-04-23 17:59 MiraMira 阅读(21) 评论(0) 推荐(0)
摘要: 860.柠檬水找零 class Solution: def lemonadeChange(self, bills: List[int]) -> bool: amt_five = 0 amt_ten = 0 amt_twenty = 0 for i in bills: if i == 5: amt_f 阅读全文
posted @ 2024-04-23 12:09 MiraMira 阅读(20) 评论(0) 推荐(0)
摘要: 1005.K次取反后最大化的数组和 class Solution: def largestSumAfterKNegations(self, nums: List[int], k: int) -> int: nums.sort(key=lambda x: abs(x), reverse=True) f 阅读全文
posted @ 2024-04-22 12:12 MiraMira 阅读(18) 评论(0) 推荐(0)
摘要: 122.买卖股票的最佳时机II class Solution: def maxProfit(self, prices: List[int]) -> int: result = 0 for i in range(len(prices)-1): if prices[i+1] - prices[i] > 阅读全文
posted @ 2024-04-20 23:20 MiraMira 阅读(24) 评论(0) 推荐(0)
摘要: 贪心算法就是先选局部最优,再推全局最优 没有套路 将问题分解为若干个子问题 找出适合的贪心策略 求解每一个子问题的最优解 将局部最优解堆叠成全局最优解 455.分发饼干 class Solution: def findContentChildren(self, g: List[int], s: Li 阅读全文
posted @ 2024-04-19 18:06 MiraMira 阅读(21) 评论(0) 推荐(0)
摘要: 332.重新安排行程 木有看懂,没视频所以也没看懂 51. N皇后 自己写出来还是有难度的 class Solution: def solveNQueens(self, n: int) -> List[List[str]]: result = [] # 存储最终结果的二维字符串数组 chessboa 阅读全文
posted @ 2024-04-18 15:27 MiraMira 阅读(15) 评论(0) 推荐(0)
摘要: 491.递增子序列 如果在最前面加一个uset = set(),这个就是给这一层一个used set,很好用,不错 class Solution: def findSubsequences(self, nums: List[int]) -> List[List[int]]: result = [] 阅读全文
posted @ 2024-04-17 16:47 MiraMira 阅读(15) 评论(0) 推荐(0)
摘要: 93.复原IP地址 class Solution: def restoreIpAddresses(self, s: str) -> List[str]: result = [] self.backtracking(s, [], 0, result) return result def backtra 阅读全文
posted @ 2024-04-16 11:37 MiraMira 阅读(15) 评论(0) 推荐(0)
摘要: 39. 组合总和 怎么才能避免重复?比现在数小的数就别append到path里面了,之前肯定都试过了 class Solution: def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]: re 阅读全文
posted @ 2024-04-15 17:56 MiraMira 阅读(17) 评论(0) 推荐(0)
摘要: 216.组合总和III class Solution: def combinationSum3(self, k: int, n: int) -> List[List[int]]: result = [] self.backtracking(k, n, 1, [], result, n) return 阅读全文
posted @ 2024-04-13 19:09 MiraMira 阅读(10) 评论(0) 推荐(0)