废纸的修炼之旅
Scroll Down最新文章
-
09 2019年11月2019年11月09日
Leetcode69 x的平方根
题目描述0分的投机取巧歪曲题意解法:class Solution: def mySqrt(self, x: int) -> int: return (int(x ** 0.5)) 二分法:class Solution: def mySqrt(self, x: in
查看全文 -
07 2019年11月
-
06 2019年11月2019年11月06日
Leetcode198 打家劫舍
题目描述解法:class Solution: def rob(self, nums: List[int]) -> int: cur, pre = 0,0 for num in nums: cur,pre = max(cur,pre + num)
查看全文 -
03 2019年11月2019年11月03日
Leetcode121 买卖股票的最佳时期[dp]
题目描述解法:class Solution: def maxProfit(self, prices: List[int]) -> int: temp = max_profit = 0 for i in range(len(prices) - 1):
查看全文 -
03 2019年11月2019年11月03日
配置环境 OR 训练时 各种奇奇怪怪的报错/bug 集中串
这几天真的好痛苦啊,各种诡异的环境问题,训练时各种bug冒出来...从结果来看,等于这几天的努力或者所谓的“工作量”都是白费了。我太难了。把手头上的事搞定以后一定要抽时间开始打kaggle比赛,从入门到放弃这篇文章用来记录各种报错/bug解决办法。11/27事太多了,搞定完开始打比赛是不存在的..t
查看全文 -
01 2019年11月
-
01 2019年11月
-
01 2019年11月2019年11月01日
Leetcode70 爬楼梯
题目描述解法:class Solution: def climbStairs(self, n: int) -> int: if n < 1: return 0 memory = {} memory[1] = 1
查看全文 -
30 2019年10月
-
28 2019年10月2019年10月28日
Leetcode292 NimGame
题目描述解法:class Solution: def canWinNim(self, n: int) -> bool: return not(n%4==0)解析:大家都是聪明人,就我不是博弈论脑筋急转弯找规律轮到自己回合面对4的倍数个的石头的人永远无法翻身,假设我拿时正好是
查看全文