摘要:
Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and ri 阅读全文
摘要:
Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers fr 阅读全文
摘要:
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
摘要:
You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos 阅读全文
摘要:
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
摘要:
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room 阅读全文
摘要:
A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
摘要:
Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
摘要:
Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example:Given 阅读全文
摘要:
Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequen 阅读全文