Smallest Range I

作者:sryan 更新时间:2020-05-26 18:07 分类:数据结构与算法

Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and...

点击数:513 回复数:0

Sort Array By Parity

作者:sryan 更新时间:2020-05-26 17:24 分类:数据结构与算法

Given an array A of non-negative integers, return an array consisting of all the even elements of A,...

点击数:558 回复数:0

Increasing Order Search Tree

作者:sryan 更新时间:2020-05-26 17:09 分类:数据结构与算法

Given a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is ...

点击数:538 回复数:0

Monotonic Array

作者:sryan 更新时间:2020-05-26 16:30 分类:数据结构与算法

An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is mono...

点击数:593 回复数:0

Fair Candy Swap

作者:sryan 更新时间:2020-05-26 16:13 分类:数据结构与算法

Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Ali...

点击数:616 回复数:0

Uncommon Words from Two Sentences

作者:sryan 更新时间:2020-05-26 15:18 分类:数据结构与算法

We are given two sentences A and B. (A sentence is a string of space separated words. Each word cons...

点击数:574 回复数:0

Middle of the linked list

作者:sryan 更新时间:2020-05-15 18:07 分类:数据结构与算法

Given a non-empty, singly linked list with head node head, return a middle node of linked list. If t...

点击数:644 回复数:0

Leaf-Similar Trees

作者:sryan 更新时间:2020-05-15 17:38 分类:数据结构与算法

Consider all the leaves of a binary tree. From left to right order, the values of those leaves form ...

点击数:601 回复数:0

Binary gap

作者:sryan 更新时间:2020-05-15 17:26 分类:数据结构与算法

Given a positive integer N, find and return the longest distance between two consecutive 1's in the ...

点击数:725 回复数:0

Transpose matrix

作者:sryan 更新时间:2020-05-15 17:12 分类:数据结构与算法

Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it...

点击数:596 回复数:0