摘要: Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
posted @ 2015-10-14 21:46 eversliver 阅读(421) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2015-10-14 21:13 eversliver 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2015-10-14 20:47 eversliver 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n). 幂运算,简单的方法snag然很好实现,直接循环相乘就可以了,但是这里应该不是那种那么简单,我的做法使用到了一点递归: 这里有个注意点就是考虑到INT_MIN的情况,做出相应的处理 下面是java写的版本: 阅读全文
posted @ 2015-10-14 09:38 eversliver 阅读(293) 评论(0) 推荐(0) 编辑