上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 29 下一页

367. Valid Perfect Square

摘要: Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library functio 阅读全文
posted @ 2017-03-06 10:43 123_123 阅读(86) 评论(0) 推荐(0) 编辑

240. Search a 2D Matrix II

摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文
posted @ 2017-03-06 10:32 123_123 阅读(86) 评论(0) 推荐(0) 编辑

35. Search Insert Position

摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2017-03-06 09:55 123_123 阅读(71) 评论(0) 推荐(0) 编辑

230. Kth Smallest Element in a BST

摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2017-03-06 09:36 123_123 阅读(71) 评论(0) 推荐(0) 编辑

378. Kth Smallest Element in a Sorted Matrix

摘要: Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th 阅读全文
posted @ 2017-03-06 09:22 123_123 阅读(75) 评论(0) 推荐(0) 编辑

392. Is Subsequence

摘要: Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is po 阅读全文
posted @ 2017-03-06 09:00 123_123 阅读(92) 评论(0) 推荐(0) 编辑

22. Generate Parentheses

摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: 阅读全文
posted @ 2017-03-06 08:12 123_123 阅读(77) 评论(0) 推荐(0) 编辑

383. Ransom Note

摘要: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
posted @ 2017-03-06 07:26 123_123 阅读(76) 评论(0) 推荐(0) 编辑

27. Remove Element

摘要: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文
posted @ 2017-03-06 06:49 123_123 阅读(71) 评论(0) 推荐(0) 编辑

345. Reverse Vowels of a String

摘要: Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = "hello", return "holle". Example 2: Given 阅读全文
posted @ 2017-03-05 09:41 123_123 阅读(82) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 29 下一页