![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二进制
文章平均质量分 78
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 · 632 阅读 · 0 评论 -
LeetCode 136. Single Number(单个数字)
原题网址:https://leetcode.com/problems/single-number/Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runti原创 2016-05-27 00:22:39 · 395 阅读 · 0 评论 -
LeetCode 231. Power of Two(2的N次幂)
原题网址:https://leetcode.com/problems/power-of-two/Given an integer, write a function to determine if it is a power of two.思路:数字n是2的整数次幂,当且仅当n的二进制表示有且只有一个1。public class Solution { public boo原创 2016-04-05 11:37:05 · 622 阅读 · 0 评论 -
LeetCode 67. Add Binary(二进制加)
原题网址:https://leetcode.com/problems/add-binary/Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".方法一:使用字符串来表示。public class So原创 2016-05-22 00:04:55 · 567 阅读 · 0 评论 -
LeetCode 233. Number of Digit One
原题网址:https://leetcode.com/problems/number-of-digit-one/Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Give原创 2016-04-06 04:10:12 · 681 阅读 · 0 评论 -
LeetCode 89. Gray Code(格雷码)
原题网址:https://leetcode.com/problems/gray-code/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原创 2016-05-23 00:34:41 · 791 阅读 · 0 评论 -
LeetCode 371. Sum of Two Integers
原题网址:https://leetcode.com/problems/sum-of-two-integers/Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return原创 2016-07-21 06:11:13 · 464 阅读 · 0 评论 -
405. Convert a Number to Hexadecimal
原题网址:https://leetcode.com/problems/convert-a-number-to-hexadecimal/Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.原创 2016-10-28 03:50:48 · 634 阅读 · 0 评论