摘要: 冒泡排序思路:列表中的每两个相邻的数,如果前面比后面的大,则交换这两个数。直到列表变为有序的时候为止,例如下面这个列表 [ 2, 1, 3, 0, 7, 6, 5, 4]第一趟: 第一步:列表的第一位... 阅读全文
posted @ 2018-10-18 21:39 fanmleii 阅读(246) 评论(0) 推荐(0)
摘要: 58.最后一个单词的长度 52msclass Solution: def lengthOfLastWord(self, s): """ :type s: str :rtype: int """ ... 阅读全文
posted @ 2018-10-18 20:45 fanmleii 阅读(106) 评论(0) 推荐(0)
摘要: 20. 有效括号 48msclass Solution: def isValid(self, s): """ :type s: str :rtype: bool """ if len(s) ... 阅读全文
posted @ 2018-10-18 00:42 fanmleii 阅读(148) 评论(0) 推荐(0)