摘要:
Remove Duplicates from Sorted Array II (M) 题目 Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice an 阅读全文
摘要:
Valid Mountain Array (E) 题目 Given an array of integers arr, return true if and only if it is a valid mountain array. Recall that arr is a mountain arr 阅读全文
摘要:
Binary Search Tree Iterator (M) 题目 Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BS 阅读全文
摘要:
Pairs of Songs With Total Durations Divisible by 60 (M) 题目 You are given a list of songs where the ith song has a duration of time[i] seconds. Return 阅读全文
摘要:
Populating Next Right Pointers in Each Node II (M) 题目 Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each 阅读全文
摘要:
Can Place Flowers (E) 题目 You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adj 阅读全文
摘要:
The kth Factor of n (M) 题目 Given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0. Consider a list 阅读全文
摘要:
Increasing Order Search Tree (M) 题目 Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is no 阅读全文
摘要:
Linked List Random Node (M) 题目 Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability 阅读全文
摘要:
Maximum Depth of Binary Tree (E) 题目 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from 阅读全文