摘要:
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
摘要:
Given an array A of strings, find any smallest string that contains each string in A as a substring. We may assume that no string in A is substring of 阅读全文
摘要:
Given a string S that only contains "I" (increase) or "D" (decrease), let N = S.length. Return any permutation A of [0, 1, ..., N] such that for all i 阅读全文
摘要:
Preorder: Approach #1: Recurisive. Approach #2: Iteratively.[Java] Approach #3: Morris Traversal.[C++] Using Morris Traversal can don't use recurisive 阅读全文
摘要:
We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we 阅读全文
摘要:
Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array if and only if: A.length >= 3 阅读全文
摘要:
We are given non-negative integers nums[i] which are written on a chalkboard. Alice and Bob take turns erasing exactly one number from the chalkboard, 阅读全文
摘要:
There are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations: When we serve some so 阅读全文
摘要:
Sometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii". Here, we have groups, of adjacent letters 阅读全文
摘要:
A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com 阅读全文