# 10.Regular Expression Matching

`hard`

Implement regular expression matching with support for ‘.’ and ‘*’.

1 | '.' Matches any single character. |

1 | class Solution { |

# 53.Maximum Subarray

`easy`

Find the contiguous subarray within an array (containing at least one number) which has the largest sum.

For example, given the array `[-2,1,-3,4,-1,2,1,-5,4]`

,

the contiguous subarray `[4,-1,2,1]`

has the largest sum = 6.

1 | class Solution { |

# 62.Unique Paths

`medium`

A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).

The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the diagram below).

How many possible unique paths are there?

1 | class Solution { |

# 63.Unique Paths II

`medium`

Now consider if some obstacles are added to the grids. How many unique paths would there be?

An obstacle and empty space is marked as 1 and 0 respectively in the grid.

For example,

there is one obstacle in the middle of a 3x3 grid as illustrated below.

1 | [ |

The total number of unique paths is `2`

.

1 | class Solution { |

# 64.Minimum Path Sum

`medium`

Given a m x n grid filled with non-negative numbers

find a path from top left to bottom right which minimizes the sum of all numbers along its path.

1 | class Solution { |

# 70.Climbing Stairs

`easy`

You are climbing a stair case. It takes n steps to reach to the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

1 | class Solution { |

# 72.Edit Distance

`hard`

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)

You have the following 3 operations permitted on a word:

- Insert a character
- Delete a character
- Replace a character

1 | class Solution { |

# 85. 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.

For example, given the following matrix:

1 | 1 0 1 0 0 |

Return 6.

1 | class Solution { |

# 91. Decode Ways

`medium`

A message containing letters from `A-Z`

is being encoded to numbers using the following mapping:

1 | 'A' -> 1 |

Given an encoded message containing digits, determine the total number of ways to decode it.

For example,

Given encoded message `"12"`

, it could be decoded as `"AB"`

(1 2) or `"L"`

(12).

The number of ways decoding `"12"`

is 2.

1 | class Solution { |

# 96. Unique Binary Search Trees

`medium`

Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?

For example,

Given n = 3, there are a total of 5 unique BST’s.

1 | 1 3 3 2 1 |

1 | class Solution { |

# 97. Interleaving String

`hard`

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.

For example,

Given:

s1 = `"aabcc"`

,

s2 = `"dbbca"`

,

When s3 = `"aadbbcbcac"`

, return `true`

.

When s3 = `"aadbbbaccc"`

, return `false`

.

1 | class Solution { |