LeetCode
Donald Su_
这个作者很懒,什么都没留下…
展开
-
[LeetCode-01]-Two Sum
文章目录题目相关Solution1. 暴力求解2. 暴力求解方法改进3. 不可行的方案后记 每周完成一个ARTS:(Algorithm、Review、Tip、Share, ARTS) Algorithm: 每周至少做一个 leetcode 的算法题 Review: 阅读并点评至少一篇英文技术文章 Tip: 学习至少一个技术技巧 Share: 分享一篇有观点和思考的技术文章 题目相关 【题目...原创 2019-03-24 13:06:15 · 156 阅读 · 0 评论 -
[LeetCode-20]-valid parentheses (括号匹配)
文章目录题目相关Solution 题目相关 【题目解读】 检查输入的括号字符串中的括号是否匹配 【原题描述】原题链接 Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is val...原创 2019-05-12 23:21:21 · 173 阅读 · 0 评论 -
[LeetCode-21]-Merge Two Sorted Lists(有序列表合并)
文章目录题目相关Solution 题目相关 【题目解读】 合并两个有序列表,并返回新列表。 【原题描述】原题链接 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. E...原创 2019-05-20 20:22:47 · 202 阅读 · 0 评论 -
[LeetCode-14]-Longest Common Prefix (最长公共前缀)
文章目录题目相关Solution 题目相关 【题目解读】 查找一个字符串数组的公共前缀。 【原题描述】原题链接 Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. ...原创 2019-04-28 23:43:53 · 122 阅读 · 0 评论 -
[LeetCode-13]-Roman to Integer (将罗马数字转换为整数)
文章目录题目相关Solution 题目相关 【题目】原题链接 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L ...原创 2019-04-21 23:10:21 · 198 阅读 · 0 评论 -
[LeetCode-09]-Palindrome Number (判断是否为回文数字)
文章目录题目相关Solution转换为字符串进行判断通过整数翻转判断 题目相关 【题目】原题链接 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true...原创 2019-04-13 21:32:44 · 192 阅读 · 0 评论 -
[LeetCode-07]-整数翻转(Reverse Integer)
文章目录题目相关Solution总结 题目相关 【题目】原题链接 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 ...原创 2019-04-13 20:59:04 · 188 阅读 · 0 评论 -
[LeetCode-03]-Longest Substring Without Repeating Characters
文章目录题目相关Solution 每周完成一个ARTS:(Algorithm、Review、Tip、Share, ARTS) Algorithm: 每周至少做一个 leetcode 的算法题 Review: 阅读并点评至少一篇英文技术文章 Tip: 学习至少一个技术技巧 Share: 分享一篇有观点和思考的技术文章 题目相关 【题目】原题链接 Given a string, find th...原创 2019-04-07 22:40:03 · 209 阅读 · 0 评论 -
[LeetCode-02]-Add Two Numbers-性能极好
文章目录题目相关Solution1. 错误的解法2. 正确解法后记 每周完成一个ARTS:(Algorithm、Review、Tip、Share, ARTS) Algorithm: 每周至少做一个 leetcode 的算法题 Review: 阅读并点评至少一篇英文技术文章 Tip: 学习至少一个技术技巧 Share: 分享一篇有观点和思考的技术文章 题目相关 【题目】原题链接 You ar...原创 2019-03-31 22:17:43 · 163 阅读 · 0 评论 -
[LeetCode-26]-Remove Duplicates from Sorted Array(从有序数组中删除重复元素)
文章目录题目相关Solution 题目相关 【题目解读】 从有序数组中删除重复元素,并返回数组的长度。 【原题描述】原题链接 Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not alloc...原创 2019-05-26 23:21:56 · 166 阅读 · 0 评论