摘要: 问题: 给定数组,和整数k 是否能将数组 刚好平均分配为,每k个一组连续递增子数组。 Example 1: Input: nums = [1,2,3,3,4,4,5,6], k = 4 Output: true Explanation: Array can be divided into [1,2, 阅读全文
posted @ 2020-07-04 20:22 habibah_chang 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个数组,对所有元素进行,按大小排名rank,同样大小排名相同。 Example 1: Input: arr = [40,10,20,30] Output: [4,1,2,3] Explanation: 40 is the largest element. 10 is the small 阅读全文
posted @ 2020-07-04 14:27 habibah_chang 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个数组,相邻两两元素构成编码,第一个元素代表出现次数,第二个元素代表出现的元素。 求编码前的原数组。 Example 1: Input: nums = [1,2,3,4] Output: [2,4,4,4] Explanation: The first pair [1,2] means 阅读全文
posted @ 2020-07-04 13:34 habibah_chang 阅读(153) 评论(0) 推荐(0) 编辑