LeetCode – Min Stack

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…

2019-07-10 · 1 分钟

LeetCode – Perfect Squares

Given a positive integer _n_, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to _n_. Example 1: Input: _n_ = Output…

2019-07-02 · 3 分钟

LeetCode – Open the Lock

You have a lock in front of you with circular wheels. Each wheel has slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rotate freely and…

2019-06-23 · 2 分钟

LeetCode – Rotate List

Given a linked list, rotate the list to the right by _k_ places, where _k_ is non-negative. Example 1: Example 2: Input: 0->1->2->NULL, k = Output: 2->0->1->…

2019-06-03 · 1 分钟

LeetCode-Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null

2019-05-28 · 2 分钟

LeetCode – Flatten a Multilevel Doubly Linked List

You are given a doubly linked list which in addition to the next and previous pointers, it could have a child pointer, which may or may not point to a separate…

2019-05-20 · 1 分钟

LeetCode – Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes

2019-05-12 · 2 分钟