摘要:
In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, \, or blank space. These characters divide the square into contiguous re 阅读全文
摘要:
Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B a 阅读全文
摘要:
Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals pre and post are distinct positive integers. 阅读全文
摘要:
Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given a pair of (string, integer). The string represents the k 阅读全文
摘要:
Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the pers 阅读全文
摘要:
uppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of th 阅读全文
摘要:
Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
摘要:
Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of sto 阅读全文
摘要:
There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next r 阅读全文
摘要:
Given two strings representing two complex numbers. You need to return a string representing their multiplication. Note i2 = -1 according to the defin 阅读全文
摘要:
A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one p 阅读全文