摘要: 1. data initialization : index = 0. 2. use a set to deduplicate the numbers. 阅读全文
posted @ 2016-07-05 15:14 keepshuatishuati 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1. Use TreeMap since it's keySet is sorted. 阅读全文
posted @ 2016-07-05 15:03 keepshuatishuati 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1. This binary search is find the insertion position. Since it starts from end of array. So it must be greater and equal to mid number. The merge sort 阅读全文
posted @ 2016-07-05 14:51 keepshuatishuati 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1. Add " " to ensure the comparision works. Or add a condition that result.length() > 0 2. character counting decrease happens before check it has bee 阅读全文
posted @ 2016-07-05 07:13 keepshuatishuati 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Basic idea: 1. starting from each element expanding to all map. Find a 0, add one to reach, and level traversal to. 2. Go through each element again. 阅读全文
posted @ 2016-07-05 07:03 keepshuatishuati 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1. Do not forget to left shift the number. 阅读全文
posted @ 2016-07-05 06:20 keepshuatishuati 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1. Do not need to check boundary case since the helper function can add "" into result. 2. Do not forget to add that character if not counting into ab 阅读全文
posted @ 2016-07-05 06:12 keepshuatishuati 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1. When divide k into two parts, it could be 0 for the any part. So i <= nums1.length. 阅读全文
posted @ 2016-07-05 05:59 keepshuatishuati 阅读(121) 评论(0) 推荐(0) 编辑