
leetcode解题之旅
我的leetcode解题历程
turing365
这个作者很懒,什么都没留下…
展开
-
leetcode 1232. Check If It Is a Straight Line
文章目录159 场周赛第一题题意思路python Easy 159 场周赛第一题 题意 You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line ...原创 2019-10-26 02:02:54 · 579 阅读 · 0 评论 -
2.Add Two Numbers
2.Add Two Numbers medium 代码还是不够熟练 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...原创 2019-04-01 06:29:20 · 192 阅读 · 0 评论 -
922. Sort Array By Parity II
922. Sort Array By Parity II Easy 题目 Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever A[i] is odd, i is ...原创 2019-01-12 07:47:17 · 162 阅读 · 0 评论 -
28. Implement strStr()
28. Implement strStr() 题目 代码: 28. Implement strStr() easy 题目 Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystac...原创 2018-06-18 21:06:10 · 189 阅读 · 0 评论 -
79. Word Search
LeetCode 79. Word Search 题目 解法 时间复杂度 空间复杂度 代码 LeetCode 79. Word Search 题目 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters o...原创 2018-06-18 09:40:06 · 336 阅读 · 0 评论 -
167. Two Sum II - Input array is sorted
167. Two Sum II - Input array is sorted easy 题目 题目 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The ...原创 2018-06-17 02:16:51 · 214 阅读 · 0 评论 -
119. Pascal's Triangle II
题目 Given a non-negative index k where k ≤ 33, return the kthkthk^{th} index row of the Pascal’s triangle. Note that the row index starts from 0. In Pascal’s triangle, each number is the sum of t...原创 2018-06-04 21:04:59 · 154 阅读 · 0 评论 -
15. 3Sum
15. 3Sum 题目描述 思路分析 代码实现 C++ java python 使用哈希+双指针 双指针,但别人优化的更好 15. 3Sum 题目描述 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find al...原创 2018-06-04 13:15:49 · 2171 阅读 · 0 评论 -
66.Plus One
66.Plus One 题目 Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the lis...原创 2018-05-28 02:09:54 · 215 阅读 · 0 评论 -
27. Remove Element
题目描述 Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the inpu...原创 2018-05-21 15:38:14 · 159 阅读 · 0 评论 -
226. Invert Binary Tree
题目描述 Invert a binary tree Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was inspired by this o...原创 2018-05-21 00:33:18 · 112 阅读 · 0 评论 -
617. Merge Two Binary Trees
题目描述 Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. Example 1: Input: Tree 1 ...原创 2018-05-20 23:36:49 · 186 阅读 · 0 评论 -
121 Best Time to Buy and Sell Stock
leetcode 121 Best Time to Buy and Sell Stock 题意 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (...原创 2019-09-01 17:41:05 · 140 阅读 · 0 评论 -
leetcode 908 Smallest Range I
Easy 题目: Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. After this process, we have some array B. Return the smallest possible diff...原创 2019-09-04 02:16:49 · 119 阅读 · 0 评论