摘要: 题目描述 Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. 题目大意 设计一个数据结构,实现以下三种操作 阅读全文
posted @ 2019-07-29 15:04 你好哇傻小妞 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Design a data structure that supports all following operations in average O(1) time. 题目大意 设计一个数据结构,实现以下三种操作: 1. 插入:如果插入一个已存在的数字则返回false,否则插入该数字返回 阅读全文
posted @ 2019-07-29 11:22 你好哇傻小妞 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it 阅读全文
posted @ 2019-07-29 11:05 你好哇傻小妞 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 题目描述 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 fr 阅读全文
posted @ 2019-07-26 13:07 你好哇傻小妞 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. 题 阅读全文
posted @ 2019-07-26 12:38 你好哇傻小妞 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 题目描述 You are given two jugs with capacities xand y litres. There is an infinite amount of water supply available. You need to determine whether it is 阅读全文
posted @ 2019-07-25 14:47 你好哇傻小妞 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals. For e 阅读全文
posted @ 2019-07-23 16:28 你好哇傻小妞 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a non-empty array of integers, return the k most frequent elements. 题目大意 寻找数组中出现频率最高的前k个数字。 示例 E1 Input: nums = [1,1,1,2,2,3], k = 2 Output 阅读全文
posted @ 2019-07-22 15:35 你好哇傻小妞 阅读(137) 评论(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 阅读全文
posted @ 2019-07-19 15:17 你好哇傻小妞 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目描述 The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, eac 阅读全文
posted @ 2019-07-19 11:28 你好哇傻小妞 阅读(153) 评论(0) 推荐(0) 编辑