上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页
摘要: 标题:Find Peak Element通过率:32.3%难度:中等A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a ... 阅读全文
posted @ 2015-02-10 11:33 pku_smile 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 标题:Search a 2D Matrix通过率31.3%难度中等Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integ... 阅读全文
posted @ 2015-02-10 11:20 pku_smile 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 标题:Set Matrix Zeroes通过率:31.3%难度:中等Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Fol... 阅读全文
posted @ 2015-02-09 11:19 pku_smile 阅读(175) 评论(0) 推荐(0) 编辑
摘要: enumerate 函数用于遍历序列中的元素以及它们的下标:>>> for i,j in enumerate(('a','b','c')):print i,j0 a1 b2 c>>> for i,j in enumerate([1,2,3]):print i,j0 11 22 3>>> for i,... 阅读全文
posted @ 2015-02-06 15:57 pku_smile 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 标题:Gray Code通过率:32.4%难度:中等The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrep... 阅读全文
posted @ 2015-02-06 15:54 pku_smile 阅读(223) 评论(0) 推荐(0) 编辑
摘要: ---恢复内容开始---标题:Letter Combinations of a Phone Number通过率:26.6%难度:中等Given a digit string, return all possible letter combinations that the number could ... 阅读全文
posted @ 2015-02-05 11:27 pku_smile 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 标题:Best Time to Buy and Sell Stock II通过率:37.3%难度:中等Say you have an array for which theithelement is the price of a given stock on dayi.Design an algor... 阅读全文
posted @ 2015-02-02 11:02 pku_smile 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 标题:Best Time to Buy and Sell Stock通过率:32%难度:中等Say you have an array for which theithelement is the price of a given stock on dayi.If you were only per... 阅读全文
posted @ 2015-02-02 10:56 pku_smile 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 标题:Spiral Matrix II通过率:31.3难度:中等Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You s... 阅读全文
posted @ 2015-02-01 11:27 pku_smile 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 标题:ZigZag Conversion通过率:22.7%难度:简单The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to displ... 阅读全文
posted @ 2015-01-28 13:38 pku_smile 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页