摘要:
Description Given a square grid of size n, each cell of which contains integer cost which represents a cost to traverse through that cell, we need to 阅读全文
摘要:
Description Rahul and Ankit are the only two waiters in Royal Restaurant. Today, the restaurant received N orders. The amount of tips may differ when 阅读全文
摘要:
Description Mike is a lawyer with the gift of photographic memory. He is so good with it that he can tell you all the numbers on a sheet of paper by h 阅读全文
摘要:
最近看hashmap源码时,发现给定初始capacity计算threshold的过程很巧妙。 1 static final int tableSizeFor(int cap) { 2 int n = cap - 1; 3 n |= n >>> 1; 4 n |= n >>> 2; 5 n |= n 阅读全文