上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 原题地址:https://oj.leetcode.com/problems/sqrtx/题意:Implementint sqrt(int x).Compute and return the square root ofx.解题思路:实现开平方函数。这里要注意的一点是返回的时一个整数。通过这一点我们可... 阅读全文
posted @ 2014-06-08 10:19 南郭子綦 阅读(4168) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/sort-colors/题意:Given an array withnobjects colored red, white or blue, sort them so that objects of the same col... 阅读全文
posted @ 2014-06-08 10:10 南郭子綦 阅读(4434) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/powx-n/题意:Implement pow(x,n).解题思路:求幂函数的实现。使用递归,类似于二分的思路,解法来自Mark Allen Weiss的《数据结构与算法分析》。正确代码:class Solution: ... 阅读全文
posted @ 2014-06-06 18:36 南郭子綦 阅读(4986) 评论(4) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/edit-distance/题意:Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2.... 阅读全文
posted @ 2014-06-06 18:07 南郭子綦 阅读(3915) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/rotate-image/题意:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Fo... 阅读全文
posted @ 2014-06-06 17:03 南郭子綦 阅读(4412) 评论(0) 推荐(1) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/length-of-last-word/题意:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', retu... 阅读全文
posted @ 2014-06-06 16:49 南郭子綦 阅读(2124) 评论(1) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/plus-one/题意:Given a non-negative number represented as an array of digits, plus one to the number.The digits are... 阅读全文
posted @ 2014-06-06 15:23 南郭子綦 阅读(3648) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/search-insert-position/题意:Given a sorted array and a target value, return the index if the target is found. If n... 阅读全文
posted @ 2014-06-06 15:14 南郭子綦 阅读(3715) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/merge-k-sorted-lists/题意:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its com... 阅读全文
posted @ 2014-06-06 12:18 南郭子綦 阅读(5559) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/sudoku-solver/题意:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated b... 阅读全文
posted @ 2014-06-05 14:26 南郭子綦 阅读(4016) 评论(3) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/valid-sudoku/题意:Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could b... 阅读全文
posted @ 2014-06-05 13:44 南郭子綦 阅读(4110) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/search-a-2d-matrix/题意:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the... 阅读全文
posted @ 2014-06-05 12:11 南郭子綦 阅读(2907) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/anagrams/题意:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be i... 阅读全文
posted @ 2014-06-05 11:39 南郭子綦 阅读(5006) 评论(3) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/spiral-matrix-ii/题意:Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.... 阅读全文
posted @ 2014-06-05 11:06 南郭子綦 阅读(2145) 评论(0) 推荐(0) 编辑
摘要: 原题地址:https://oj.leetcode.com/problems/spiral-matrix/题意:Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral orde... 阅读全文
posted @ 2014-06-05 10:46 南郭子綦 阅读(4182) 评论(1) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页