上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 19 下一页
摘要: Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a functio 阅读全文
posted @ 2017-07-09 15:22 王大咩的图书馆 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2). You are given a target value 阅读全文
posted @ 2017-07-09 15:00 王大咩的图书馆 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 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: 题意:给定1...n个数, 阅读全文
posted @ 2017-07-09 10:56 王大咩的图书馆 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 题意:仅要求给出解的种数。 思路:这题是n que 阅读全文
posted @ 2017-07-08 16:54 王大咩的图书馆 阅读(176) 评论(0) 推荐(0) 编辑
摘要: The n-queens puzzle is the problem of placing n queens on an n×nchessboard such that no two queens attack each other. Given an integer n, return all d 阅读全文
posted @ 2017-07-08 16:44 王大咩的图书馆 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to show follow up. Follow up: Did you use extra sp 阅读全文
posted @ 2017-07-08 15:25 王大咩的图书馆 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: For example, Give 阅读全文
posted @ 2017-07-08 13:23 王大咩的图书馆 阅读(393) 评论(0) 推荐(1) 编辑
摘要: A message containing letters fromA-Zis being encoded to numbers using the following mapping: Given an encoded message containing digits, determine the 阅读全文
posted @ 2017-07-07 22:20 王大咩的图书馆 阅读(296) 评论(0) 推荐(0) 编辑
摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文
posted @ 2017-07-07 17:03 王大咩的图书馆 阅读(234) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文
posted @ 2017-07-07 09:30 王大咩的图书馆 阅读(321) 评论(0) 推荐(0) 编辑
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 ="aabcc",s2 ="dbbca", When s3 ="aadbbcbcac", return 阅读全文
posted @ 2017-07-06 20:35 王大咩的图书馆 阅读(291) 评论(0) 推荐(0) 编辑
摘要: Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Elements in a subset must be in non-descending ord 阅读全文
posted @ 2017-07-06 15:57 王大咩的图书馆 阅读(1074) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must no 阅读全文
posted @ 2017-07-06 15:17 王大咩的图书馆 阅读(3024) 评论(0) 推荐(0) 编辑
摘要: 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-07-06 10:24 王大咩的图书馆 阅读(229) 评论(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-07-06 08:57 王大咩的图书馆 阅读(478) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 19 下一页