摘要:
Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer 阅读全文
摘要:
Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point o 阅读全文
摘要:
Given the root of a binary tree with N nodes, each node in the tree has node.val coins, and there are N coins total. In one move, we may choose two ad 阅读全文
摘要:
At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bil 阅读全文
摘要:
Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly and uniformily picks an integer point in the space 阅读全文
摘要:
Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren 阅读全文
摘要:
Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop o 阅读全文
摘要:
A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only. We would like to convert the 阅读全文
摘要:
Return all non-negative integers of length N such that the absolute difference between every two consecutive digits is K. Note that every number in th 阅读全文
摘要:
Alice has a hand of cards, given as an array of integers. Now she wants to rearrange the cards into groups so that each group is size W, and consists 阅读全文