## 四则运算

### Pow(x, n)

Leetcode 50

Implement pow(x, n), which calculates x raised to the power n (xn).

## Divide Two Integers

Leetcode 29

Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.

Return the quotient after dividing dividend by divisor.

The integer division should truncate toward zero.

Example 1:

Example 2:

### Sum of Two Integers

Leetcode 371

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.

Given a = 1 and b = 2, return 3.

## 前缀相关

### Power of Two

Leetcode 231

Given an integer, write a function to determine if it is a power of two.

### Bitwise AND of Numbers Range

Leetcode 201

Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.

### Number Complement

Leetcode 476

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.

## 位个数和位移动操作

### Number of 1 Bits

Leetcode 191

Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight).

### Reverse Bits

Leetcode 190

Reverse bits of a given 32 bits unsigned integer.

### Total Hamming Distance

Leetcode 477

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

Now your job is to find the total Hamming distance between all pairs of the given numbers.

## 重复使用抑或操作

### Missing Number

Leetcode 268

Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.

### Single Number

Leetcode 136

Given a non-empty array of integers, every element appears twice except for one. Find that single one.

### Single Number II

Leetcode 137

Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one.

### Single Number III

Leetcode 260

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.

Leetcode 397