leetcode
fisty
hi
展开
-
【leetcode 】 57 Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Examp...原创 2018-05-02 14:43:24 · 194 阅读 · 0 评论 -
【leetcode】No.56. Merge Intervals 区间合并 题解
Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlap...原创 2018-04-26 17:05:24 · 243 阅读 · 0 评论 -
【leetcode】55. Jump Game 动态规划解法
55. Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determ...原创 2018-04-19 16:34:32 · 1150 阅读 · 1 评论 -
【leetcode】 64. Minimum Path Sum 动态规划
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at a...原创 2018-05-04 17:42:41 · 400 阅读 · 0 评论 -
【leetcode】111. Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is a node with no childre...原创 2018-05-19 17:04:23 · 228 阅读 · 0 评论 -
【leetcode】 75. Sort Colors
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the in...原创 2018-05-15 16:35:07 · 201 阅读 · 0 评论 -
【leetcode148 Sort List】链表归并排序,空间复杂度o(logn)
Sort a linked list in O(n log n) time Example 1:Input: 4->2->1->3 Output: 1->2->3->4Example 2:Input: -1->5->3->4->0 Output: -1->0->3->4->5 解析: 先递归原创 2018-07-23 17:56:40 · 329 阅读 · 0 评论 -
【leetcode206】206. Reverse Linked List 反转链表
Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL迭代版/** * Definition for singly-linked list. * struct ListNode { * ...原创 2018-08-02 17:31:45 · 226 阅读 · 0 评论