![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode题解
文章平均质量分 67
Follow_Inner_Heart
蚂蚁,坚持,喜爱算法,关注大数据和智能家居。
展开
-
LeetCode Two Sum
题目链接:http://oj.leetcode.com/problems/two-sum/Two Sum Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indi原创 2014-03-16 17:52:30 · 518 阅读 · 0 评论 -
【leetcode】Palindrome Partitioning && Palindrome Partitioning II
Palindrome Partitioning链接:https://oj.leetcode.com/problems/palindrome-partitioning/ 描述:Given a string s, partition s such that every substring of the partitio原创 2014-07-25 17:33:38 · 466 阅读 · 0 评论 -
【leetcode】Longest Consecutive Sequence
链接:https://oj.leetcode.com/problems/longest-consecutive-sequence/描述:原创 2014-07-26 14:06:56 · 495 阅读 · 0 评论 -
Sum Root to Leaf Numbers
链接:描述:原创 2014-07-26 14:11:03 · 418 阅读 · 0 评论 -
【leetcode】Surrounded Regions
链接:https://oj.leetcode.com/problems/surrounded-regions/描述:原创 2014-07-26 14:13:36 · 492 阅读 · 0 评论 -
【leetcode】Word Ladder
Word Ladder链接:https://oj.leetcode.com/problems/word-ladder/ 描述:Given two words (start and end), and a dictionary, find the length of shortest transfor原创 2014-07-26 15:21:57 · 587 阅读 · 0 评论 -
【leetcode】Max Points on a Line
链接:https://oj.leetcode.com/problems/max-points-on-a-line/int maxPoints(vector &points){ int size = points.size(); if(size <= 0 ) return 0; map statics; int result = 0; int max = 0; int inf原创 2014-07-17 23:31:19 · 420 阅读 · 0 评论 -
【leetcode】Populating Next Right Pointers in Each Node
Populating Next Right Pointers in Each Node链接:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/原创 2014-07-28 23:12:59 · 571 阅读 · 0 评论 -
【leetcode】Valid Palindrome
链接:https://oj.leetcode.com/problems/valid-palindrome/描述:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A ma原创 2014-07-28 22:41:02 · 428 阅读 · 0 评论 -
×【leetcode】Binary Tree Maximum Path Sum
链接:https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/描述:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:原创 2014-07-28 22:45:52 · 711 阅读 · 0 评论 -
【leetcode】Triangle
链接:https://oj.leetcode.com/problems/triangle/描述:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For exam原创 2014-07-28 23:00:01 · 405 阅读 · 0 评论 -
【leetcode】Best Time to Buy and Sell Stock I && II && III
Best Time to Buy and Sell Stock链接原创 2014-07-28 22:59:44 · 645 阅读 · 0 评论 -
【leetcode】Pascal's Triangle && Pascal's Triangle II
链接:https://oj.leetcode.com/problems/pascals-triangle/描述:Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1],原创 2014-07-28 23:06:30 · 422 阅读 · 0 评论 -
【leetcode】Simplify Path
链接:https://oj.leetcode.com/submissions/detail/9774025/描述:Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/"原创 2014-08-14 21:44:21 · 505 阅读 · 0 评论 -
【leetcode】Valid Number
连接:https://oj.leetcode.com/problems/valid-number/原创 2014-08-16 09:28:39 · 583 阅读 · 0 评论 -
【leetcode】Clone Graph
链接:https://oj.leetcode.com/problems/clone-graph/描述:Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serializatio原创 2014-07-25 17:21:41 · 536 阅读 · 0 评论 -
【leetcode】Word Break && Word Break II
Word Break II 链接:https://oj.leetcode.com/problems/word-break-ii/描述:Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid原创 2014-07-22 15:54:00 · 560 阅读 · 0 评论 -
【leetcode】Gas Station
int start = 0;int total = 0;int tank = 0;for(int i=0; i {tank = tank + gas[i] - cost[i];if( tank {start = i + 1;total += tank;tank = 0;}}return (total + tank)>= 0 ? s原创 2014-07-22 23:33:08 · 448 阅读 · 0 评论 -
LeetCode Longest Substring Without Repeating Characters
题目链接:http://oj.leetcode.com/problems/longest-substring-without-repeating-characters/Longest Substring Without Repeating Characters Given a string, find the length of the longest substrin原创 2014-03-16 20:29:45 · 586 阅读 · 0 评论 -
LeetCode Add Two Numbers
题目链接:http://oj.leetcode.com/problems/add-two-numbers/描述:Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order a原创 2014-03-16 20:49:45 · 673 阅读 · 0 评论 -
【leetcode】Evaluate Reverse Polish Notation
链接:https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand ma原创 2014-07-17 22:21:40 · 367 阅读 · 0 评论 -
【leetcode】Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification:What constitutes原创 2014-07-17 21:20:42 · 565 阅读 · 0 评论 -
【leetcode】LRU Cache
链接:https://oj.leetcode.com/problems/lru-cache/描述:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(原创 2014-07-18 22:58:51 · 558 阅读 · 0 评论 -
【leetcode】Sort List
链接:https://oj.leetcode.com/problems/sort-list/描述:原创 2014-07-18 13:27:30 · 385 阅读 · 0 评论 -
【leetcode】Insertion Sort List
链接:https://oj.leetcode.com/problems/insertion-sort-list/描述:Sort a linked list using insertion sort.代码:原创 2014-07-18 13:56:07 · 469 阅读 · 0 评论 -
【leetcode】Reorder List
链接:https://oj.leetcode.com/problems/reorder-list/原创 2014-07-21 22:19:05 · 388 阅读 · 0 评论 -
【leetcode】Binary Tree Postorder Traversal
链接:https://oj.leetcode.com/problems/binary-tree-postorder-traversal/原创 2014-07-21 21:14:31 · 345 阅读 · 0 评论 -
【leetcode】Candy
Candy链接:原创 2014-07-22 22:36:48 · 419 阅读 · 0 评论 -
【leetcode】Linked List Cycle && Linked List Cycle II
链接:https://oj.leetcode.com/problems/linked-list-cycle-ii/Linked List Cycle II Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow原创 2014-07-21 23:00:34 · 443 阅读 · 0 评论 -
【leetcode】Single Number && Single Number II
Single Number原创 2014-07-22 21:54:01 · 659 阅读 · 0 评论 -
【LeetCode】 Longest Palindrome Substring
题目链接:http://oj.leetcode.com/problems/longest-palindromic-substring/题目描述:Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that th原创 2014-03-17 22:47:53 · 584 阅读 · 0 评论 -
【leetcode】Copy List with Random Pointer
链接:描述:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.原创 2014-07-22 17:15:22 · 413 阅读 · 0 评论 -
【leetcode】Permutation Sequence
链接:https://oj.leetcode.com/problems/permutation-sequence/描述:The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,原创 2014-08-16 20:39:33 · 725 阅读 · 0 评论