
数据结构
yufengsong09
热爱技术,热爱生活
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode---69. Sqrt(x)---Python实现
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: 4Output: 2Example 2:Input: 8Output: 2Explanation: Th原创 2018-01-22 15:33:58 · 792 阅读 · 0 评论 -
LeetCode 70 Climbing Stairs--Python实现
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 climb to the top?Note: Given n will be a positive原创 2018-01-22 16:36:58 · 259 阅读 · 0 评论 -
LeetCode 72. Edit Distance-----Python实现
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 the following 3 operations permitted on a word:原创 2018-01-24 00:18:53 · 300 阅读 · 0 评论 -
LeetCode 61. Rotate List---Python实现
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->NULL.本题关键在于构建一个循环链表,注意k要对链表长度取余。# Defi原创 2018-01-16 14:33:23 · 176 阅读 · 0 评论 -
LeetCode 62.Unique Paths---Python实现
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 point in time. The robot is trying to reach the原创 2018-01-16 14:48:40 · 844 阅读 · 0 评论 -
LeetCode 64. Minimum Path Sum---Python实现
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原创 2018-01-16 15:13:29 · 250 阅读 · 0 评论 -
LeetCode 63. Unique Paths II--Python实现
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 is marked as 1 and 0 respectively in the原创 2018-01-16 15:01:22 · 296 阅读 · 0 评论 -
LeetCode 65. Valid Number--Python实现
Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement to be ambiguo原创 2018-01-16 15:55:17 · 601 阅读 · 0 评论 -
LeetCode 77. Combinations--python实现
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]原创 2018-01-29 11:53:27 · 353 阅读 · 0 评论