摘要: 题目: Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: I 阅读全文
posted @ 2020-04-29 19:32 silentteller 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted by frequency from highest to lowest. If two wor 阅读全文
posted @ 2020-04-29 18:55 silentteller 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 简介 抽象工厂模式在工厂模式上添加了一个创建不同工厂的抽象接口(抽象类或接口实现),该接口可叫做超级工厂。在使用过程中,我们首先通过抽象接口创建出不同的工厂对象,然后根据不同的工厂对象创建不同的对象。 具体实现 1.抽象工厂定义如下 public abstract class AbstractFac 阅读全文
posted @ 2020-04-29 00:59 silentteller 阅读(172) 评论(0) 推荐(0) 编辑