程序媛詹妮弗
终身学习
摘要: Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文
posted @ 2018-10-22 08:49 程序媛詹妮弗 阅读(211) 评论(0) 推荐(0) 编辑
摘要: This is a follow up problem to Search in Rotated Sorted Array, where nums may contain duplicates. 思路 该题是[leetcode]33. Search in Rotated Sorted Array旋转 阅读全文
posted @ 2018-10-22 08:33 程序媛詹妮弗 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure.find 阅读全文
posted @ 2018-10-22 08:01 程序媛詹妮弗 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ 阅读全文
posted @ 2018-10-22 07:47 程序媛詹妮弗 阅读(221) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2018-10-22 07:17 程序媛詹妮弗 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 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 程序媛詹妮弗 阅读(104) 评论(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 程序媛詹妮弗 阅读(116) 评论(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 程序媛詹妮弗 阅读(700) 评论(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 程序媛詹妮弗 阅读(167) 评论(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 程序媛詹妮弗 阅读(136) 评论(0) 推荐(0) 编辑