LeetCode
文章平均质量分 50
htdwade
这个作者很懒,什么都没留下…
展开
-
LeetCode题解 —— 1. 两数之和
题目描述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...原创 2018-05-22 22:49:55 · 328 阅读 · 0 评论 -
LeetCode题解 —— 3. 无重复字符的最长子串
Given a string, find the length of the longest substring without repeating characters.exampleGiven “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”, with the leng原创 2018-05-22 22:55:53 · 325 阅读 · 0 评论 -
LeetCode题解 —— 4. 寻找两个有序数组的中位数
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)).example1nums1 = [1, 3]nums2 =原创 2018-05-22 22:59:02 · 434 阅读 · 0 评论 -
LeetCode题解 —— 5. 最长回文子串
题目描述Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: &quo原创 2018-05-23 21:59:02 · 202 阅读 · 0 评论 -
LeetCode题解 —— 6. Z 字形变换
题目描述The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P ...原创 2018-05-24 10:37:20 · 249 阅读 · 0 评论 -
LeetCode题解 —— 2. 两数相加
题目描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and re...原创 2018-05-22 22:50:50 · 183 阅读 · 0 评论 -
LeetCode题解 —— 7. 整数反转
题目描述给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。示例 1:输入: 123输出: 321示例 2:输入: -123输出: -321示例 3:输入: 120输出: 21注意:假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−2^31, 2^31 − 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。解题思想...原创 2018-11-22 22:26:09 · 208 阅读 · 0 评论