String
feeeeeeet
这个作者很懒,什么都没留下…
展开
-
Leetcode 22. Generate Parentheses
class Solution { public List<String> generateParenthesis(int n) { List<String> res=new ArrayList<String>(); generate(res,"",n,0,0); return res; } ...原创 2018-11-15 04:15:50 · 78 阅读 · 0 评论 -
Leetcode 28. Implement strStr()
3 Solutions - Brute Force & KMP Solution 1 Brute Force using Pointers (slow) class Solution { public int strStr(String haystack, String needle) { int left=0; int right=0; ...原创 2018-11-17 02:56:23 · 82 阅读 · 0 评论 -
Leetcode 38. Count and Say
class Solution: def countAndSay(self, n): """ :type n: int :rtype: str """ res="1" if n==1: return res for i in range(n-1): ...原创 2018-12-04 11:53:44 · 63 阅读 · 0 评论 -
Leetcode 43. Multiply Strings
https://blog.csdn.net/u010983881/article/details/77503519 class Solution: def multiply(self, num1, num2): """ :type num1: str :type num2: str :rtype: str "...原创 2018-12-05 05:05:22 · 74 阅读 · 0 评论 -
Leetcode 49. Group Anagrams
class Solution(object): def groupAnagrams(self, strs): """ :type strs: List[str] :rtype: List[List[str]] """ strings, res, ans = [], {}, [] for s in...原创 2018-12-05 23:38:09 · 58 阅读 · 0 评论 -
Leetcode 76. Minimum Window Substring
sliding window: find a window that contains all the characters in t, then reduce the window by moving start pointer but still contains all the characters. class Solution: def minWindow(self, s, t)...原创 2018-12-29 06:10:35 · 97 阅读 · 0 评论