计数
文章平均质量分 77
jmspan
这个作者很懒,什么都没留下…
展开
-
LeetCode 137. Single Number II(单个数字)
原题网址:https://leetcode.com/problems/single-number-ii/ Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a lin原创 2016-05-27 00:22:35 · 620 阅读 · 0 评论 -
LeetCode 191. Number of 1 Bits(比特数)
原题网址:https://leetcode.com/problems/number-of-1-bits/ Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example原创 2016-05-04 03:05:52 · 433 阅读 · 0 评论 -
LeetCode 200. Number of Islands(小岛)
https://leetcode.com/problems/number-of-islands/ Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting原创 2016-05-04 04:23:07 · 1804 阅读 · 0 评论 -
LeetCode 201. Bitwise AND of Numbers Range(范围内所有数值的比特与)
原题网址:https://leetcode.com/problems/bitwise-and-of-numbers-range/ Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4. 思路:总体思路就是求出m和n的高位比特的公共前缀。 方法一:变动前缀本身。原创 2016-05-04 05:21:07 · 411 阅读 · 0 评论 -
LeetCode 248. Strobogrammatic Number III
原题网址:https://leetcode.com/problems/strobogrammatic-number-iii/ A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to co原创 2016-04-07 08:04:04 · 993 阅读 · 0 评论 -
LeetCode 38. Count and Say(点数)
原题网址:https://leetcode.com/problems/count-and-say/ The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.原创 2016-05-20 10:40:38 · 328 阅读 · 0 评论