摘要:
题目There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank a... 阅读全文
摘要:
题目Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1-... 阅读全文
摘要:
题目Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1, 3, 2]... 阅读全文
摘要:
题目Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes’ ... 阅读全文
摘要:
题目Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.分析求解一个二维平面上所有点中,位于同一直线上的最多点数。首先想到的算法就是首先... 阅读全文
摘要:
题目Description:Count the number of prime numbers less than a non-negative number, n.Credits: Special thanks to @mithmatt for adding this probl... 阅读全文
摘要:
题目Reverse a singly linked list.click to show more hints.Hint: A linked list can be reversed either iteratively or recursively. Could you impl... 阅读全文