摘要: Note: 1. We start with different position and different length to find the shortening. 2. It satisfy following conditions : I. if length < 4, it short 阅读全文
posted @ 2017-10-15 16:09 keepshuatishuati 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Note: All the points should be even since it will be dispeared by perfect joint. Thus only 4 points will be left. 阅读全文
posted @ 2017-10-15 15:52 keepshuatishuati 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Note: This solution is combined with Trie + Generialized Abbreviation: 1. Since it looks for smallest one, we need persist a string to find minimum le 阅读全文
posted @ 2017-10-13 17:24 keepshuatishuati 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Note: The update height with MAX(current height, real height) is because how many water this block can held depends on all outside heights. Another th 阅读全文
posted @ 2017-10-13 15:34 keepshuatishuati 阅读(147) 评论(0) 推荐(0) 编辑
摘要: DFS to search all possible combine. 阅读全文
posted @ 2017-10-12 15:44 keepshuatishuati 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Note: This question is very similiar to Median from Data Stream 阅读全文
posted @ 2017-10-12 15:01 keepshuatishuati 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Note: DP means we have (i, end) keys and starting from j position how many "STEPS" we need. This does not include press button step. 阅读全文
posted @ 2017-10-11 14:56 keepshuatishuati 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Note: Standard combination generation: 1. Do not return when find diff < 0. Because i + 1 could satisfy. 2. Since it does not return, it requires chec 阅读全文
posted @ 2017-10-10 16:29 keepshuatishuati 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Note: This is kind of recurrsive dedup questions. 阅读全文
posted @ 2017-10-10 16:12 keepshuatishuati 阅读(119) 评论(0) 推荐(0) 编辑
摘要: class Solution { public double findMaxAverage(int[] nums, int k) { if (nums.length 0.00001) { double mid = (minValue + maxValue) * 0.5; if (checkValue(nums, mid, ... 阅读全文
posted @ 2017-10-10 15:25 keepshuatishuati 阅读(148) 评论(0) 推荐(0) 编辑