摘要:
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
阅读(93)
推荐(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
阅读(100)
推荐(0)
编辑
摘要:
Nlog(N) could be get the sum for each steps and binary search of it.
阅读全文
posted @ 2017-08-23 15:04
keepshuatishuati
阅读(109)
推荐(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
阅读(91)
推荐(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
阅读(84)
推荐(0)
编辑
摘要:
1. Remember to add it again after counting since there are still remaining information in cache.
阅读全文
posted @ 2017-08-23 13:48
keepshuatishuati
阅读(70)
推荐(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
阅读(125)
推荐(0)
编辑