
Bit Manipulation
文章平均质量分 65
豆腐脑是咸的
这个作者很懒,什么都没留下…
展开
-
Subsets (Java)
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 not contain duplicate subsets. For exa原创 2015-01-19 09:39:52 · 657 阅读 · 0 评论 -
Repeated DNA Sequences (Java)
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. Wri原创 2015-02-18 15:31:09 · 823 阅读 · 0 评论 -
Single Number (Java)
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using ext原创 2015-01-04 16:49:36 · 482 阅读 · 0 评论 -
Single Number II (Java)
Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without usi原创 2015-01-05 10:25:28 · 447 阅读 · 0 评论 -
Majority Element (Java)
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element原创 2014-12-22 14:25:20 · 953 阅读 · 0 评论