上一页 1 2 3 4 5 6 ··· 36 下一页
摘要: Note: 1. Find each steps lowest cost. 2. Find whether it could reach to end or not. 阅读全文
posted @ 2017-10-10 14:45 keepshuatishuati 阅读(266) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int lengthLongestPath(String input) { if (input.length() == 0) return 0; String[] layers = input.split("\n"); int[] stack = new int[layers.length +... 阅读全文
posted @ 2017-10-09 13:45 keepshuatishuati 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 1. Use priority queue. Need to check whether one element has been double counted: 2 Binary search: For this kind of matrix, binary search should work 阅读全文
posted @ 2017-10-09 13:19 keepshuatishuati 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Resevior Sampling : https://en.wikipedia.org/wiki/Reservoir_sampling 阅读全文
posted @ 2017-10-08 16:59 keepshuatishuati 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Note: 1. Find a increasing digits number. It's kind of longest increasing subsequence but with fixed size. 2. Remember to remove the zeros from beginn 阅读全文
posted @ 2017-10-08 16:24 keepshuatishuati 阅读(109) 评论(0) 推荐(0) 编辑
摘要: This is SO AWESOME solution. 阅读全文
posted @ 2017-10-08 16:02 keepshuatishuati 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Note: 1. 0 could be 10 but not valid for 01. Check edge cases. 2. No number shoud be there as num reduced. 阅读全文
posted @ 2017-10-08 15:40 keepshuatishuati 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Note: end should apply end of left to right order using i index start is right to left using length - i - 1 index. Set end to be -2 since result is en 阅读全文
posted @ 2017-09-20 15:30 keepshuatishuati 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Almost same as Longest Common SubString 阅读全文
posted @ 2017-09-20 14:50 keepshuatishuati 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Since it required exactly one modification, it is better to use following solution. Other ise, the Trie solution can work. (At least one modify). 阅读全文
posted @ 2017-09-20 14:37 keepshuatishuati 阅读(135) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 36 下一页