上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页
摘要: 我太难了,俩小时。。。。。。 class Solution(object): def isNumber(self, s): """ :type s: str :rtype: bool """ s=s.strip() for i in range(len(s)): if s[i] not in 'e0 阅读全文
posted @ 2019-10-11 20:12 欣姐姐 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 看着挺简单,结果不断出错不断修改,就很容易绕晕了,用了一个小时四十分钟左右才完成。。。好慢哦: class Solution(object): def myAtoi(self, str): """ :type str: str :rtype: int """ a=str.lstrip() if le 阅读全文
posted @ 2019-10-11 17:23 欣姐姐 阅读(268) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def convert(self, s, numRows): """ :type s: str :type numRows: int :rtype: str """ if numRows==1: return s if len(s)<2: return 阅读全文
posted @ 2019-10-11 15:58 欣姐姐 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 执行用时 :2192 ms, 在所有 Python 提交中击败了50.51%的用户 内存消耗 :115.1 MB, 在所有 Python 提交中击败了5.06%的用户 虽然好不容易用俩小时左右做出来了,但是感觉还是有地方很啰嗦。 执行用时为 20 ms 的范例 class Solution(obje 阅读全文
posted @ 2019-10-11 13:59 欣姐姐 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 执行用时 :16 ms, 在所有 Python 提交中击败了92.62%的用户 内存消耗 :11.7 MB, 在所有 Python 提交中击败了35.95%的用户 执行用时为 8 ms 的范例 class Solution(object): def findComplement(self, num) 阅读全文
posted @ 2019-10-10 17:38 欣姐姐 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 执行用时 :16 ms, 在所有 Python 提交中击败了95.32%的用户 内存消耗 :11.7 MB, 在所有 Python 提交中击败了25.00%的用户 执行用时为 4 ms 的范例 import math class Solution(object): def isPowerOfTwo( 阅读全文
posted @ 2019-10-10 17:17 欣姐姐 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 执行用时 :16 ms, 在所有 Python 提交中击败了94.92%的用户 内存消耗 :11.7 MB, 在所有 Python 提交中击败了31.64%的用户 ——2019.10.10 阅读全文
posted @ 2019-10-10 17:09 欣姐姐 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 将十进制数转换为二进制数:使用bin()函数即可 二进制转十进制用int函数: 但是操作的时候却遇到了错误:ValueError: invalid literal for int() with base 2: '1101111b0' 解决办法: 仔细看是因为十进制转换为二进制的时候,会有一个前缀为0 阅读全文
posted @ 2019-10-10 17:03 欣姐姐 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 执行用时 :44 ms, 在所有 Python3 提交中击败了90.44%的用户 内存消耗 :13.8 MB, 在所有 Python3 提交中击败了5.21%的用户 执行用时为 20 ms 的范例 class Solution: def reverse(self, x: int) -> int: r 阅读全文
posted @ 2019-10-10 16:12 欣姐姐 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 执行用时 :32 ms, 在所有 Python3 提交中击败了100.00%的用户 内存消耗 :13.8 MB, 在所有 Python3 提交中击败了5.26%的用户 真棒!! ——2019.10.9 阅读全文
posted @ 2019-10-09 21:40 欣姐姐 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页