摘要: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should be the 阅读全文
posted @ 2016-08-10 12:45 Hygeia 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d vectors: By calling next repeatedly until  阅读全文
posted @ 2016-08-10 11:10 Hygeia 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. [分析]首先别忘了什么是factorial,就是 阅读全文
posted @ 2016-08-10 10:54 Hygeia 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 这题真特么是太难了 解题思路 首先我们先把原数组全部异或起来,那么我们会得到一个数字,这个数字是两个不相同的数字异或的结果,我们取出其中任意一位为‘1’的位,为了方便起见,我们用 a &= -a 来取出最右端为‘1’的位。。。这道题的巧妙之处在于利用x1 ^ x2的结果对原数组进行了分组,进而将x1 阅读全文
posted @ 2016-08-10 10:41 Hygeia 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 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 3. Credits:Speci 阅读全文
posted @ 2016-08-10 04:09 Hygeia 阅读(166) 评论(0) 推荐(0) 编辑