
leetcode
小黄人的banana
码农,敲代码中
展开
-
[LeetCode] Perfect Squares 完全平方数
[LeetCode] Perfect Squares 完全平方数 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12,转载 2016-08-18 21:02:05 · 653 阅读 · 0 评论 -
【Leetcode】 Next Permutation(31)
Next Permutation(31)Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange原创 2016-09-08 10:17:09 · 325 阅读 · 0 评论 -
【Leetcode】Permutation Sequence(60)
Permutation SequenceThe set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3原创 2016-09-08 10:35:58 · 436 阅读 · 1 评论 -
【leetcode】191. Number of 1 Bits 关于位运算的几个小技巧。191. Number of 1 Bits()
191. Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has b原创 2016-09-21 20:23:47 · 622 阅读 · 0 评论 -
【LeetCode】467. Unique Substrings in Wraparound String
问题描述Consider the string s to be the infinite wraparound string of “abcdefghijklmnopqrstuvwxyz”, so s will look like this: “…zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd….”.Now we have anot原创 2017-03-01 19:40:15 · 595 阅读 · 0 评论 -
[leetcode]187. Repeated DNA Sequences
题目:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG”. When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.Write原创 2017-02-24 10:23:45 · 391 阅读 · 0 评论 -
【LeetCode】441. Arranging Coins
题目You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the total number of full staircase rows that can be formed.n is a原创 2017-02-24 20:48:25 · 400 阅读 · 0 评论