摘要:
class Solution { public int romanToInt(String s) { int result = 0; for (int i = 0; i < s.length(); i++) { switch(s.charAt(i)) { case 'M': ... 阅读全文
摘要:
LOTS of EDGE CASES: 1. Root path, when we return, it needs to be checked. 2. When we meet "..", we shall check whether it is root path or not, but do 阅读全文
摘要:
Nlog(N) could be get the sum for each steps and binary search of it. 阅读全文
摘要:
class Solution { public int findKthLargest(int[] nums, int k) { if (nums.length == 0) { return 0; } return findKth(nums, 0, nums.length - 1, nums.length - k); ... 阅读全文
摘要:
Since the input is ordered and not overlapped intervals. It is OK to have this kind of simply implementation. 阅读全文
摘要:
1. Remember to add it again after counting since there are still remaining information in cache. 阅读全文
摘要:
1. Need check whether each loop of 1000 is 0 or not. Otherwise, it will introduce extra "thousands" words. 2. Each loop needs to count the how many th 阅读全文