每日一例leetcode
kyo23333
这个作者很懒,什么都没留下…
展开
-
Longest Substring Without Repeating Characters
//first one,时间复杂度o(n) //使用map表,键值分别记录每一个字符和其对应的最后一次出现的位置 //start表示最左合法边界,当m[c]>start时出现重复字符,则start+1调整边界int lengthOfLongestSubstring(string s) { int res = 0; map<char, int> m;原创 2017-10-19 19:09:08 · 139 阅读 · 0 评论 -
two sum
问题描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the s原创 2017-10-21 22:55:19 · 108 阅读 · 0 评论 -
add string
问题描述: Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2 is < 5100. Both num1 and num2 contains only digits 0-9原创 2017-10-21 23:15:38 · 429 阅读 · 0 评论