摘要:
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. Return a deep copy 阅读全文
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 阅读全文
摘要:
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and 阅读全文
摘要:
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). nvertical lines are drawn such that the two endpoi 阅读全文
摘要:
Given preorder and inorder traversal of a tree, construct the binary tree. Given in-order [1,2,3] and pre-order [2,1,3], return a tree: 阅读全文
摘要:
Given inorder and postorder traversal of a tree, construct the binary tree. Given inorder [1,2,3] and postorder [1,3,2], return a tree: 阅读全文
摘要:
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is:[[2,4],[3,4],[ 阅读全文
摘要:
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in Cwhere the candidate numbers sums to T. Each numb 阅读全文
摘要:
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文
摘要:
There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. T 阅读全文