摘要: 问题: 设计类LRUCache,实现LRU Cache Least Recently Used 优先度为:最近使用优先 的缓存。 缓存大小一定,capacity get(key):通过key查找value,若缓存中不存在key,返回-1 put(key, value):插入缓存key=value。 阅读全文
posted @ 2021-04-14 19:44 habibah_chang 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 问题: 将给定正整数n,拆成多个数。(使得这些数之和=n) 这些数之积最大是多少。 Example 1: Input: n = 2 Output: 1 Explanation: 2 = 1 + 1, 1 × 1 = 1. Example 2: Input: n = 10 Output: 36 Exp 阅读全文
posted @ 2021-04-14 13:56 habibah_chang 阅读(55) 评论(0) 推荐(0) 编辑