Given a list of Connections, which is the Connection class (the city name at both ends of the ...
Given an integer array with no duplicates. A max tree building on this array is defined as follow: The root is the maximum number in the array The left subtree and right subtree are the max trees of t ...
2014-12-27 01:40 1 3471 推荐指数:
Given a list of Connections, which is the Connection class (the city name at both ends of the ...
DP. boolean d[i][j]: For the first i items, can we fill a backpack of size j? true or false ...
Coins in a Line III There are n coins in a line. Two players take turns to take a coin from one of ...
There are n coins with different value in a line. Two players take turns to take one or two coins fr ...
直接+没什么好说的,关键在于不用+的操作: 考验Bit Operation, 可以用按位^异或两个操作数对应位以及carry,只是carry是1还是0需要分情况讨论。求更优的解法 ...
接雨水 给出 n 个非负整数,代表一张X轴上每个区域宽度为 1 的海拔图, 计算这个海拔图最多能接住多少(面积)雨水。 如上图所示,海拔分别为 [0,1,0,2,1,0,1,3,2,1, ...
Given an directed graph, a topological order of the graph nodes is defined as follow: For each d ...
There is a stone game.At the beginning of the game the player picks n piles of stones in a ci ...