
string
MVincent
这个作者很懒,什么都没留下…
展开
-
leetcode 93 Restore IP Addresses
python:class Solution: def restoreIpAddresses(self, s): """ :type s: str :rtype: List[str] """ def dfs(s, index, path, res): if index == 4: ...原创 2018-06-25 11:18:15 · 193 阅读 · 0 评论 -
leetcode 387 First Unique Character in a String
python:class Solution: def firstUniqChar(self, s): """ :type s: str :rtype: int """ l = dict() for i in list(s): if i in l: ...原创 2018-07-13 14:49:17 · 199 阅读 · 0 评论 -
leetcode 804 Unique Morse Code Words
python:class Solution: def uniqueMorseRepresentations(self, words): """ :type words: List[str] :rtype: int """ m = [".-","-...","-.-.","-.."原创 2018-09-11 16:41:09 · 230 阅读 · 0 评论 -
leetcode 859 Buddy Strings
python:class Solution: def buddyStrings(self, A, B): """ :type A: str :type B: str :rtype: bool """ if A == B: return len(set(A)) !=...原创 2018-09-12 15:41:16 · 218 阅读 · 0 评论 -
819 Most Common Word
python;class Solution: def mostCommonWord(self, paragraph, banned): """ :type paragraph: str :type banned: List[str] :rtype: str """ res = ('', -...原创 2018-10-23 16:49:32 · 298 阅读 · 0 评论