摘要:
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], 阅读全文
posted @ 2018-10-22 07:06
程序媛詹妮弗
阅读(110)
评论(0)
推荐(0)
摘要:
Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the vali 阅读全文
posted @ 2018-10-22 07:03
程序媛詹妮弗
阅读(126)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2018-10-22 06:31
程序媛詹妮弗
阅读(742)
评论(0)
推荐(0)
摘要:
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: 阅读全文
posted @ 2018-10-22 06:15
程序媛詹妮弗
阅读(179)
评论(0)
推荐(0)
摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp 阅读全文
posted @ 2018-10-22 06:05
程序媛詹妮弗
阅读(150)
评论(0)
推荐(0)
浙公网安备 33010602011771号