DiamondI's blog

Home

About

Archives

155. Min Stack

155. Min Stack Description Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() – Get the top element. getMin() – Retrieve the minimum element in the stack.

Read more

154. Find Minimum in Rotated Sorted Array II

154. Find Minimum in Rotated Sorted Array II Description Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Find the minimum element.

Read more

153. Find Minimum in Rotated Sorted Array

153. Find Minimum in Rotated Sorted Array Description Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Find the minimum element.

Read more

152. Maximum Product Subarray

152. Maximum Product Subarray Description Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.

Read more

149. Max Points on a Line

149. Max Points on a Line Description Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

Read more

143. Reorder List

143. Reorder List Description Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…

Read more
1234