LeetCode
文章平均质量分 71
孑辞
尽吸西江,细斟北斗,万象为宾客。
展开
-
LeetCode 1.Two Sum题解
题目1.Two SumGiven 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 u...原创 2018-10-15 19:28:16 · 118 阅读 · 0 评论 -
LeetCode 4. Median of Two Sorted Arrays题解
题目4. Median of Two Sorted ArraysThere 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...原创 2018-10-22 19:02:58 · 271 阅读 · 0 评论 -
LeetCode 2. Add Two Numbers题解
题目2. Add Two NumbersYou 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 tw...原创 2018-10-21 01:00:20 · 163 阅读 · 0 评论 -
LeetCode 3. Longest Substring Without Repeating Characters题解
题目3. Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.给定字符串,求出不含重复字符的最长连续子串。Example 1:Input: "abcabcbb"Output:...原创 2018-10-21 17:53:01 · 229 阅读 · 0 评论 -
LeetCode 5. Longest Palindromic Substring题解
文章目录题目5. Longest Palindromic Substring分析思路一:动态规划思路二:(从中央位置开始)双向扩展扫描题解思路一Java实现思路二Java实现题目5. Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assum...原创 2019-04-24 10:28:23 · 147 阅读 · 0 评论 -
LeetCode 6. ZigZag Conversion题解
文章目录题目6. ZigZag Conversion分析题目6. ZigZag ConversionThe 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 fo...原创 2019-07-12 08:31:43 · 229 阅读 · 0 评论 -
LeetCode 7. Reverse Integer题解
文章目录题目7. Reverse Integer分析思路一:利用`StringBuilder`特性思路二:按位依次翻转题解Java实现思路一Java实现思路二C++实现思路二题目7. Reverse IntegerGiven a 32-bit signed integer, reverse digits of an integer.给出一个 32 位的有符号整数,你需要将这个整数中每位上的...原创 2019-08-21 08:02:53 · 318 阅读 · 0 评论