摘要: 问题: 给定一组数,求其中最大子set,使得set中其中任意两元素之间: a%b=0 or b%a=0 Example 1: Input: nums = [1,2,3] Output: [1,2] Explanation: [1,3] is also accepted. Example 2: Inp 阅读全文
posted @ 2021-04-15 19:56 habibah_chang 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 问题: 设计数据结构,使得完成以下功能: 关注用户: void follow(int followerId, int followeeId) 取关用户: void unfollow(int followerId, int followeeId) 某用户发状态: void postTweet(int 阅读全文
posted @ 2021-04-15 17:10 habibah_chang 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 问题: 设计结构体,能够满足以下两个功能: 向结构体中插入数据 void addNum(int num) 去当前结构体中的中位数 double findMedian() 若共有奇数个数,取最中间的数 若共有偶数个数,取中间两个数之和/2 Example 1: Input ["MedianFinder 阅读全文
posted @ 2021-04-15 15:00 habibah_chang 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 相关问题:146. LRU Cache 问题: 设计类LFUCache,实现LFU Cache Least Frequently Used 优先度为:访问频率最多优先 的缓存。 缓存大小一定,capacity get(key):通过key查找value,若缓存中不存在key,返回-1 put(key 阅读全文
posted @ 2021-04-15 11:59 habibah_chang 阅读(58) 评论(0) 推荐(0) 编辑