# bit-manipulation

1/3ページ

## [LintCode] Number of 1 bits

Problem Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1′ bits it has (also known as the Hamming wei […]

## [LintCode] Flip Bits

Problem Determine the number of bits required to flip if you want to convert integer n to integer m. Example Given n = 31 (11111), m = 14 (01110),

## [LintCode] Binary Representation

Problem Given a (decimal – e.g. 3.72) number that is passed in as a string, return the binary representation that is passed in as a string. If t […]

## [LintCode/CC] Update Bits [Merge Bits]

Problem Given two 32-bit numbers, N and M, and two bit positions, i and j. Write a method to set all bits between i and j in N equal to M (e g , M bec […]

## [LintCode] Unique Characters

Problem Implement an algorithm to determine if a string has all unique characters. Example Given “abc”, return true. Given “aab̶ […]

## [LintCode/LeetCode] Single Number III

Problem Given 2*n 2

## [LintCode/LeetCode] Single Number I & II [位運算]

Single Number I Problem Given 2*n 1 HashSet public class Solution { public int singleNumber(int[] A) { if (A == null || A.length == 0) return 0; Set&l […]

## [LeetCode] Counting Bits

Problem Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num