05 2018 档案

摘要:There are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w. Now given all the cities and fights, togethe 阅读全文
posted @ 2018-05-30 11:31 Grandyang 阅读(12312) 评论(4) 推荐(0) 编辑
摘要:Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible stri 阅读全文
posted @ 2018-05-21 09:21 Grandyang 阅读(6140) 评论(2) 推荐(1) 编辑
摘要:Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa 阅读全文
posted @ 2018-05-19 23:46 Grandyang 阅读(4755) 评论(1) 推荐(0) 编辑
摘要:An N x N board contains only 0s and 1s. In each move, you can swap any 2 rows with each other, or any 2 columns with each other. What is the minimum n 阅读全文
posted @ 2018-05-17 22:32 Grandyang 阅读(5142) 评论(0) 推荐(1) 编辑
摘要:In a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how many other rabbits have the same color as them. Th 阅读全文
posted @ 2018-05-15 23:39 Grandyang 阅读(4242) 评论(1) 推荐(1) 编辑
摘要:A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y). Given a starting point (sx, sy) and a target point (tx, t 阅读全文
posted @ 2018-05-13 23:22 Grandyang 阅读(5465) 评论(3) 推荐(0) 编辑
摘要:On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence 阅读全文
posted @ 2018-05-11 23:55 Grandyang 阅读(5012) 评论(0) 推荐(0) 编辑
摘要:On an N x N grid, each square grid[i][j] represents the elevation at that point (i,j). Now rain starts to fall. At time t, the depth of the water ever 阅读全文
posted @ 2018-05-09 23:26 Grandyang 阅读(5886) 评论(2) 推荐(1) 编辑
摘要:In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or repla 阅读全文
posted @ 2018-05-07 10:54 Grandyang 阅读(5778) 评论(4) 推荐(0) 编辑
摘要:Given a Binary Search Tree (BST) with root node root, and a target value V, split the tree into two subtrees where one subtree has nodes that are all 阅读全文
posted @ 2018-05-04 23:40 Grandyang 阅读(5991) 评论(2) 推荐(0) 编辑
摘要:We have some permutation A of [0, 1, ..., N - 1], where N is the length of A. The number of (global) inversions is the number of i < j with 0 <= i < j 阅读全文
posted @ 2018-05-02 23:07 Grandyang 阅读(3299) 评论(4) 推荐(1) 编辑

Fork me on GitHub