## Trapping Rain Water

Question Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. This question is provided by LeetCode.

Question Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. This question is provided by LeetCode.

Question Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle

1 2 3 4 5 6 |
[ [2], [3,4], [6,5,7], [4,1,8,3] ] |

The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11). Note: Bonus point Read the full article…

Question Implement wildcard pattern matching with support for ‘?’ and ‘*’. ‘?’ Matches any single character. ‘*’ Matches any sequence of characters (including the empty sequence). The matching should cover the entire input string (not partial). The function prototype should be: bool isMatch(const char *s, const char *p) This question is provided by LeetCode.

QUESTION Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once. This question is provided by Leetocode.

QUESTION Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a time Each intermediate word must exist in the dictionary Note: Return 0 if there is no such transformation sequence. All words have the same Read the full article…

QUESTION Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node’s key. The right subtree of a node contains only nodes with keys greater than the node’s key. Both Read the full article…

QUESTION Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all valid but “(]” and “([)]” are not. This question is provided by Leetocode.

QUESTION Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. This question is provided by Leetocode.

QUESTION Follow up for “Unique Paths”: 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. This question is provided by Leetocode.

QUESTION 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 Read the full article…

- « Previous Page
- 1
- 2
- 3
- 4
- …
- 13
- Next Page »