摘要: 问题: 给出一个数组,求至少拿出几个元素,使得他们出现的次数之和,>=总元素个数的一半 Example 1: Input: arr = [3,3,3,3,5,5,5,2,2,7] Output: 2 Explanation: Choosing {3,7} will make the new arra 阅读全文
posted @ 2020-06-28 13:17 habibah_chang 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 问题: 给出一组全路径文件数组,删除子目录。 Example 1: Input: folder = ["/a","/a/b","/c/d","/c/d/e","/c/f"] Output: ["/a","/c/d","/c/f"] Explanation: Folders "/a/b/" is a 阅读全文
posted @ 2020-06-28 12:42 habibah_chang 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定由【姓名,时间,数额,城市】组成的交易信息数组。 求无效交易的数组。 无效:1 or 2满足 1,数额>1000 2,相同姓名,不同城市,时间差<60 Example 1: Input: transactions = ["alice,20,800,mtv","alice,50,100,b 阅读全文
posted @ 2020-06-28 11:53 habibah_chang 阅读(169) 评论(0) 推荐(0) 编辑