leetcode:两个数的和||
摘要:两个数的和|| 给定一个排序数组,求出其中两个数的和等于指定target时,这两个数在原始数组中的下标,返回的下标从1开始 解题 原始数组已经是升序的,找出其中两个数的和等于target 定义两个指针,left right 计算x = num[left] + num[right] 的值 等于targ
阅读全文
leetcode 5 :Longest Palindromic Substring 找出最长回文子串
摘要:题目: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 翻译: 找出字符串s中最长的回文子串,...
阅读全文
leetcode 4 : Median of Two Sorted Arrays 找出两个数组的中位数
摘要:题目: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 题意: 两个排序后的数组nums1 和num...
阅读全文
LeetCode 3-Longest Substring Without Repeating Characters
摘要:Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
阅读全文
LeetCode 2-Add Two Numbers
摘要:Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co...
阅读全文
LeeCode 1-Two Sum
摘要:Two SumTotal Accepted: 125096 Total Submissions: 705262Question SolutionGiven an array of integers, find two numbers such that they add up to a specif...
阅读全文