随笔分类 -  array(中心开花)

845. Longest Mountain in Array
摘要:2,1,4,7,3,2,5 0 0 1 20 0 1 1 0 0 21 00 阅读全文

posted @ 2018-11-08 16:11 猪猪🐷

238. Product of Array Except Self
摘要:if concerned with 0, check the elements on the side first, the situation in the middle is handled Given an array nums of n integers where n > 1, retur 阅读全文

posted @ 2018-08-17 08:11 猪猪🐷

334. Increasing Triplet Subsequence
摘要:Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Note: Your algo 阅读全文

posted @ 2018-07-18 08:56 猪猪🐷

42. Trapping Rain Water
摘要:space optimization 这个计算就是多了个心眼, 用我妈的话来说, 用leftmax 时不用计算另一半, 是因为left Max比 right Max小的时候, 如果像上一个方法, 我们还是取两个中最小的 , 那么我们就不用知道rightMax具体是多少, 反正我们知道比left Ma 阅读全文

posted @ 2018-07-18 08:55 猪猪🐷

导航