随笔分类 -  Leetcode

上一页 1 ··· 8 9 10 11 12
14. Longest Common Prefix
摘要:Write a function to find the longest common prefix string amongst an array of strings. 找出,给出的一堆字符串的公共前缀。两个两个比较 阅读全文
posted @ 2017-07-17 20:09 Beserious 阅读(110) 评论(0) 推荐(0) 编辑
13. Roman to Integer
摘要:Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 给出罗马数字 输出对应的阿拉伯数字。思路来自29的罗马数字 观看罗马数字构造规则(h 阅读全文
posted @ 2017-07-17 19:36 Beserious 阅读(130) 评论(0) 推荐(0) 编辑
9. Palindrome Number
摘要:Determine whether an integer is a palindrome. Do this without extra space. 就是判断 反转后的整数和反转之前的整数是否相等 阅读全文
posted @ 2017-07-17 16:55 Beserious 阅读(93) 评论(0) 推荐(0) 编辑
7. Reverse Integer
摘要:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Note:The input is assumed to be a 32-bit signed integer. Yo 阅读全文
posted @ 2017-07-17 14:45 Beserious 阅读(102) 评论(0) 推荐(0) 编辑
1. Two Sum
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2017-07-04 22:21 Beserious 阅读(133) 评论(0) 推荐(0) 编辑
123. Best Time to Buy and Sell Stock III
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-05-25 10:45 Beserious 阅读(126) 评论(0) 推荐(0) 编辑
139. Word Break
摘要:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For 阅读全文
posted @ 2016-04-05 18:25 Beserious 阅读(241) 评论(0) 推荐(0) 编辑
90. Subsets II
摘要:Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: Elements in a subset must be in non-descending 阅读全文
posted @ 2016-04-05 18:23 Beserious 阅读(126) 评论(0) 推荐(0) 编辑
78. Subsets
摘要:Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must 阅读全文
posted @ 2016-04-05 18:22 Beserious 阅读(171) 评论(0) 推荐(0) 编辑
77. Combinations
摘要: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: 阅读全文
posted @ 2016-04-05 18:21 Beserious 阅读(138) 评论(0) 推荐(0) 编辑
40. Combination Sum II
摘要:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each num 阅读全文
posted @ 2016-04-05 16:55 Beserious 阅读(157) 评论(0) 推荐(0) 编辑
39. Combination Sum
摘要:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文
posted @ 2016-04-05 16:52 Beserious 阅读(194) 评论(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 @ 2016-04-05 16:49 Beserious 阅读(193) 评论(0) 推荐(0) 编辑
51. N-Queens
摘要:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all 阅读全文
posted @ 2016-04-03 13:02 Beserious 阅读(176) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12