Hyuvo

Results 7 comments of Hyuvo

**Java 双闭区间**,倔强青铜改也不知道为啥改对了,应该是@Burkhardttt 说的int溢出: The 'int' boundaries are -2147483648 to 2147483647. 最大的test case是piles = [805306368,805306368,805306368], h = 1000000000, 乍一看好像也没有超出范围,不过也只能是这个case运算之后超了int的上界,然后被JVM转成Integer.MIN_VALUE了 The results are specified by the language and independent of the JVM...

感觉648直接用string 的join比StringBuilder省事一点呢 ```Java class Solution { public String replaceWords(List dictionary, String sentence) { // put the dict in a trie set and use the shortestPrefixOf method TrieSet dict = new...

211 只要把children 数组大小优化成26就不会超时啦 ```Java class WordDictionary { private final TrieMap map; public WordDictionary() { map = new TrieMap(); } public void addWord(String word) { // use key to store word,...

有点不太明白为什么hasNext那里add的时候要从后面数然后addFirst呢?正着数然后add不可以吗?是addFirst() 比 add()复杂度低吗?

噢我知道了,是把nested list unnest然后按原顺序放回去

710 的Java版 ```java class Solution { private HashMap mapping; private Random random; private int size; public Solution(int n, int[] blacklist) { mapping = new HashMap(); random = new Random(); size...

@saw008 审题 >备忘录解法,l_max[i] 和 r_max[i] 分别代表 height[0..i] 和 height[i..end] 的最高柱子高度。 所以两个max至少是当前柱子height,所以差最小是0