程序媛詹妮弗
终身学习
摘要: Given an array w of positive integers, where w[i] describes the weight of index i, write a function pickIndex which randomly picks an index in proport 阅读全文
posted @ 2018-10-24 07:05 程序媛詹妮弗 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. Example: Solution1: HashMap + ArrayList 1. use an ArrayList toget 阅读全文
posted @ 2018-10-24 06:55 程序媛詹妮弗 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: T 阅读全文
posted @ 2018-10-24 06:49 程序媛詹妮弗 阅读(96) 评论(0) 推荐(0) 编辑
摘要: S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per 阅读全文
posted @ 2018-10-24 06:45 程序媛詹妮弗 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2018-10-24 06:41 程序媛詹妮弗 阅读(120) 评论(0) 推荐(0) 编辑