02 2019 档案
摘要:Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S =
阅读全文
摘要:Given a string S of digits, such as S = "123456579", we can split it into a Fibonacci-like sequence [123, 456, 579]. Formally, a Fibonacci-like sequen
阅读全文
摘要:Given a binary search tree and a node in it, find the in-order successor of that node in the BST. The successor of a node p is the node with the small
阅读全文
摘要: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
阅读全文
摘要:A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum. Gi
阅读全文
摘要:There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to t
阅读全文
摘要:Alice plays the following game, loosely based on the card game "21". Alice starts with 0 points, and draws numbers while she has less than K points. D
阅读全文
摘要:A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bottom-left corner, and (x2, y2) are the coordinates
阅读全文
摘要:Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.) Your car drives automatically accord
阅读全文
摘要:Two images A and B are given, represented as binary, square matrices of the same size. (A binary matrix has only 0s and 1s as values.) We translate on
阅读全文
摘要:To some string S, we will perform some replacement operations that replace groups of letters with new ones (not necessarily the same size). Each repla
阅读全文
摘要:Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means t
阅读全文