LeetCode
Crearns
这个作者很懒,什么都没留下…
展开
-
LeetCode# 53: Maximum Subarray(动态规划实现)
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,4,-1,2,1,-5,4], Output: 6 Explanation:...原创 2019-01-23 21:41:58 · 426 阅读 · 0 评论 -
LeetCode #67: Add Binary
Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Example 1: Input: a = "11", b = "1" Output: "100" Example ...原创 2019-01-23 22:16:16 · 231 阅读 · 0 评论 -
LeetCode# 28:Implement strStr() (KMP算法实现)
Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: I...原创 2019-01-22 11:55:19 · 236 阅读 · 0 评论