摘要:
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet... 阅读全文
摘要:
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb... 阅读全文
摘要:
这道题的算法第一次可能有点难想,但是做过一次后就知道了 Shi Li Analysis(会好理解很多): Starting from the last position, the first time we find that num[i]<num[i+1], we stop. The positi 阅读全文
摘要:
这道题跟Insert Intervals这道题很像,最开头要先对Intervals里面的Interval排序一下,用到了java的Collections.sort(List<Interval> list, Comparator<? super Interval> c)。 排序以Interval的st 阅读全文
摘要:
难度:90 String问题里面有很多不好做的,动不动就DP什么的,参考了一些资料http://blog.csdn.net/fightforyourdream/article/details/17373203 For example,S = “ADOBECODEBANC”T = “ABC”Minim 阅读全文