# LeetCode 85. Maximal Rectangle

## Description

Maximal Rectangle

Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.

Example:

``````Input:
[
["1","0","1","0","0"],
["1","0","1","1","1"],
["1","1","1","1","1"],
["1","0","0","1","0"]
]
Output: 6
``````

# LeetCode 76. Minimum Window Substring

## Description

Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).

Example:

``````Input: S = "ADOBECODEBANC", T = "ABC"
Output: "BANC"
``````

Note:

• If there is no such window in S that covers all characters in T, return the empty string “".
• If there is such window, you are guaranteed that there will always be only one unique minimum window in S.

# LeetCode 36. Valid Sudoku

Valid Sudoku

## Description

Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:

1. Each row must contain the digits `1-9` without repetition.
2. Each column must contain the digits `1-9` without repetition.
3. Each of the 9 `3x3` sub-boxes of the grid must contain the digits `1-9` without repetition.

A partially filled sudoku which is valid.

The Sudoku board could be partially filled, where empty cells are filled with the character `'.'`.

# LeetCode 18. 4Sum

4Sum

## Description

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.

Note: The solution set must not contain duplicate quadruplets.

``````For example, given array S = [1, 0, -1, 0, -2, 2], and target = 0.

A solution set is:
[
[-1,  0, 0, 1],
[-2, -1, 1, 2],
[-2,  0, 0, 2]
]
``````

# LeetCode 37. Sudoku Solver

Sudoku Solver

## Description

Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character ‘.'. You may assume that there will be only one unique solution.

# LeetCode 3. Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

## Description

Given a string, find the length of the longest substring without repeating characters.

Given “abcabcbb”, the answer is “abc”, which the length is 3.

Given “bbbbb”, the answer is “b”, with the length of 1.

Given “pwwkew”, the answer is “wke”, with the length of 3. Note that the answer must be a substring, “pwke” is a subsequence and not a substring.

# LeetCode 1. Two Sum

Two Sum

## Description

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

``````Example:
Given nums = [2, 7, 11, 15], target = 9,
``````

Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1].

Programer

ChengDu·China