Number of Islands
Number of Islands题目Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is
Number of Islands题目Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is
Basic Calculator题目Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing
Evaluate Reverse Polish Notation题目Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /.
Maximal Rectangle题目Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all ones and return its area. 思路每
Largest Rectangle in Histogram题目Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find
Min Stack题目Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. -push(x) — Push element x onto
Trapping Rain Water题目Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it
Simplify Path题目Given an absolute path for a file (Unix-style), simplify it. For example, path = “/home/“, => “/home” path = “/a/./b/../..
Valid Parenthese题目Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. The
Invert Binary Tree题目invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3