Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and...
Given an array A of non-negative integers, return an array consisting of all the even elements of A,...
Given a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is ...
An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is mono...
Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Ali...
We are given two sentences A and B. (A sentence is a string of space separated words. Each word cons...
Given a non-empty, singly linked list with head node head, return a middle node of linked list. If t...
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form ...
Given a positive integer N, find and return the longest distance between two consecutive 1's in the ...
Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it...