摘要: Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" 阅读全文
posted @ 2017-11-10 11:38 逸朵 阅读(130) 评论(0) 推荐(0)
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2017-11-10 11:08 逸朵 阅读(96) 评论(0) 推荐(0)
摘要: Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. Example 1: Input: 4 Output: 2 Exampl 阅读全文
posted @ 2017-11-10 10:58 逸朵 阅读(117) 评论(0) 推荐(0)
摘要: Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algor 阅读全文
posted @ 2017-11-10 06:51 逸朵 阅读(157) 评论(0) 推荐(0)
摘要: Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space 阅读全文
posted @ 2017-11-10 05:21 逸朵 阅读(125) 评论(0) 推荐(0)
摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2017-11-10 05:09 逸朵 阅读(134) 评论(0) 推荐(0)
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. Example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->N 阅读全文
posted @ 2017-11-10 05:03 逸朵 阅读(134) 评论(0) 推荐(0)
摘要: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia 阅读全文
posted @ 2017-11-09 07:54 逸朵 阅读(115) 评论(0) 推荐(0)
摘要: n LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascendi 阅读全文
posted @ 2017-11-09 06:58 逸朵 阅读(152) 评论(0) 推荐(0)
摘要: Given a collection of intervals, merge all overlapping intervals. For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. 阅读全文
posted @ 2017-11-09 06:44 逸朵 阅读(144) 评论(0) 推荐(0)