摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2017-05-25 21:13 D-Dong 阅读(264) 评论(0) 推荐(0) 编辑
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 阅读全文
posted @ 2017-05-25 15:52 D-Dong 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 翻转32位无符号二进制整数 Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010 阅读全文
posted @ 2017-05-25 15:18 D-Dong 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 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, the 32-bit 阅读全文
posted @ 2017-05-25 14:36 D-Dong 阅读(213) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/hamming-distance/#/description 输入:两个整数x,y,且0 ≤ x, y < 231。 输出:x,y的二进制表示,不同的有几位。 Example: 阅读全文
posted @ 2017-05-25 11:54 D-Dong 阅读(291) 评论(0) 推荐(0) 编辑