水中的鱼
Monday, August 7, 2017
[Leetcode] Min Stack, Solution
›
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. ...
[Leetcode] Find Peak Element, Solution
›
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1] , find a peak element and ...
[Leetcode] Fraction to Recurring Decimal, Solution
›
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part...
[Leetcode] Number of Islands, Solution
›
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 ...
[Leetcode] Basic Calculator, Solution
›
Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ...
[Leetcode] Summary Ranges, Solution
›
Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7] , return ["0-...
[Leetcode] Search a 2D Matrix II, Solution
›
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in ea...
‹
›
Home
View web version