129.Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, …
Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in the last 10 seconds.
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
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 formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
Write a function that takes a string as input and reverse only the vowels of a string.
Write a function that takes a string as input and returns the string reversed.
Example:
Given s = “hello”, return “olleh”.
1 | public class SmallestAdjacent { |
1 | public class Solution { |
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.