摘要: Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in 阅读全文
posted @ 2019-01-06 17:27 fatttcat 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [9,4] Exam 阅读全文
posted @ 2019-01-06 17:03 fatttcat 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Design a max stack that supports push, pop, top, peekMax and popMax. Example 1: Note: 基本思路同 153. Min Stack,用两个stack 注意popMax()的时候要先把stack中的元素pop出来,直到找 阅读全文
posted @ 2019-01-06 15:49 fatttcat 阅读(185) 评论(0) 推荐(0) 编辑