摘要:
Sort a linked list in O(n log n) time using constant space complexity. 思路:模拟merge sort。 阅读全文
摘要:
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room 阅读全文
摘要:
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
摘要:
Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any 阅读全文
摘要:
Given n points on a 2D plane, find if there is such a line parallel to y-axis that reflect the given points. Example 1: Given points = [[1,1],[-1,1]], 阅读全文
摘要:
For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible roote 阅读全文
摘要:
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
摘要:
Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using one bomb.T 阅读全文
摘要:
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th 阅读全文
摘要:
You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu 阅读全文