This is a problem from Leetcode - Smallest Range II.
Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and add x to A[i] (only once).
After this process, we have some array B.
Return the smallest possible difference between the maximum value of B and the minimum value of B.
- Jun 13, 2019...more
- Jun 12, 2019...more
This is a problem from Leetcode - Insufficient Nodes in Root to Leaf Paths.
Given the root of a binary tree, consider all root to leaf paths: paths from the root to any leaf. (A leaf is a node with no children.)
A node is insufficient if every such root to leaf path intersecting this node has sum strictly less than limit.
Delete all insufficient nodes simultaneously, and return the root of the resulting binary tree.
- Jun 11, 2019...more
This is a problem from Leetcode - Smallest Subsequence of Distinct Characters.
Return the lexicographically smallest subsequence of text that contains all the distinct characters of text exactly once.
- Jun 10, 2019...more
This is a problem from Leetcode - Letter Tile Possibilities.
You have a set of tiles, where each tile has one letter tiles[i] printed on it. Return the number of possible non-empty sequences of letters you can make.
- Jun 6, 2019...more
This is a problem from Leetcode -Greatest Common Divisor of Strings.
For strings S and T, we say “T divides S” if and only if S = T + … + T (T concatenated with itself 1 or more times)
Return the largest string X such that X divides str1 and X divides str2.