摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack.pop() -- Remove 阅读全文
posted @ 2019-06-10 20:00 lpomeloz 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-06-10 19:09 lpomeloz 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
posted @ 2019-06-10 18:05 lpomeloz 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, w 阅读全文
posted @ 2019-06-10 17:23 lpomeloz 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 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 comple 阅读全文
posted @ 2019-06-10 16:00 lpomeloz 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2019-06-10 11:27 lpomeloz 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's trian 阅读全文
posted @ 2019-06-10 10:04 lpomeloz 阅读(131) 评论(0) 推荐(0) 编辑