## Search a 2D Matrix

Write an efficient algorithm that searches for a value in an `m x n`

matrix. If the target value is in the matrix, return `true`

; otherwise, return `false`

.

## First Position of Target

For a given sorted array (ascending order) and a target number, find the first index of this number in `O(log n)`

time complexity. If the target number does not exist in the array, return `-1`

.

## Reverse Linked List

Reverse a linked list in-place and in one-pass.

## Recover Rotated Sorted Array

Given a rotated sorted array, recover it to sorted array in-place. A rotated array is an array in which its elements are shifted. For example, `[3, 4, 1, 2]`

is a rotated array of array `[1, 2, 3, 4]`

by 2 places.

## Insert Interval

Given a non-overlapping interval list which is sorted by start point. Insert a new interval into it, make sure the list is still in order and non-overlapping (merge intervals if necessary).

## Reverse Words in a String

Given an input string, reverse the string word by word.

## Product of Array Exclude Itself

Given an integers array `A`

of length `n`

, calculate array `B`

of length `n`

, where `B[i]`

is the product all elements of array `A`

except `A[i]`

. In other words, let `p = A[0] × ... × A[n - 1]`

, `B[i] = p / A[i]`

. Do the computation without using the division operator.

## Minimum Subarray

Given an array of integers, find the subarray with smallest sum and return the sum. The subarray should contain at least one element from the array.

## Maximum Subarray

Given an array of integers, find the contiguous subarray with the largest sum and return the sum. The subarray should contain at least one element from the array.

## Majority Number

Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find the number with O(n) time and O(1) space.