摘要:
class Solution { public int romanToInt(String s) { int result = 0; for (int i = 0; i < s.length(); i++) { switch(s.charAt(i)) { case 'M': ... 阅读全文
posted @ 2017-08-23 15:40
keepshuatishuati
阅读(96)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-08-23 15:26
keepshuatishuati
阅读(109)
评论(0)
推荐(0)
摘要:
Nlog(N) could be get the sum for each steps and binary search of it. 阅读全文
posted @ 2017-08-23 15:04
keepshuatishuati
阅读(114)
评论(0)
推荐(0)
摘要:
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); ... 阅读全文
posted @ 2017-08-23 15:04
keepshuatishuati
阅读(96)
评论(0)
推荐(0)
摘要:
Since the input is ordered and not overlapped intervals. It is OK to have this kind of simply implementation. 阅读全文
posted @ 2017-08-23 14:17
keepshuatishuati
阅读(93)
评论(0)
推荐(0)
摘要:
1. Remember to add it again after counting since there are still remaining information in cache. 阅读全文
posted @ 2017-08-23 13:48
keepshuatishuati
阅读(77)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-08-23 13:38
keepshuatishuati
阅读(129)
评论(0)
推荐(0)
浙公网安备 33010602011771号