摘要: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
posted @ 2017-11-10 11:55 逸朵 阅读(107) 评论(0) 推荐(0)
摘要: 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)