摘要:
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], 阅读全文
摘要:
Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the vali 阅读全文
摘要:
Design a max stack that supports push, pop, top, peekMax and popMax. Example 1: Note: 题目 思路 1. maintain stack to track all the data 2. maintain maxSta 阅读全文
摘要:
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp 阅读全文