摘要: 问题: 给定一个数组,求交换其中两个元素,使得到数组全部元素组成下一个较小的数值 Example 1: Input: [3,2,1] Output: [3,1,2] Explanation: Swapping 2 and 1. Example 2: Input: [1,1,5] Output: [1 阅读全文
posted @ 2020-06-06 13:02 habibah_chang 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个每分钟来客数量的数组,和一个同一时刻店主是否松懈的数组, 如果店主松懈:1,那么那一分钟的来客满意度为0,否则满意度=来客数量。 店主有一技巧可使得,即使店主松懈,来客也能够满足X分钟。这一技巧只能用一次, 求一段时间的最大满意度和。 Example 1: Input: custom 阅读全文
posted @ 2020-06-06 10:40 habibah_chang 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 问题: 给出一组字符串,求所有字符串共有的字符数组。 Example 1: Input: ["bella","label","roller"] Output: ["e","l","l"] Example 2: Input: ["cool","lock","cook"] Output: ["c","o 阅读全文
posted @ 2020-06-06 09:15 habibah_chang 阅读(177) 评论(0) 推荐(0) 编辑