上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 44 下一页
摘要: 问题: 给定n个汽车站之间的距离数组distances(相邻两个站相连,收尾站相连,可顺时针逆时针两个方向行驶) 求start站和destination站之间的最短距离。 Example 1: Input: distance = [1,2,3,4], start = 0, destination = 阅读全文
posted @ 2020-07-05 09:54 habibah_chang 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一组目标字符串数组 queries,和一个参照系字符串数组 words 求queries中的各个字符串:最小字符出现次数< words中最小字符出现次数的参照字符串的个数。 记字符串出现最小次数为函数fun Example 1: Input: queries = ["cbd"], wor 阅读全文
posted @ 2020-07-05 09:33 habibah_chang 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定数组,和整数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) 编辑
摘要: 问题: 给定由0,1构成的数组,求由1构成的(各种长度边长的)正方形的总个数有多少。 Example 1: Input: matrix = [ [0,1,1,1], [1,1,1,1], [0,1,1,1] ] Output: 15 Explanation: There are 10 squares 阅读全文
posted @ 2020-06-29 19:49 habibah_chang 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 问题: 替换当前元素为,当前元素以后元素的最大值。 最后一个元素替换为-1。 Example 1: Input: arr = [17,18,5,4,6,1] Output: [18,6,6,6,1,-1] Constraints: 1 <= arr.length <= 10^4 1 <= arr[i 阅读全文
posted @ 2020-06-29 14:30 habibah_chang 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个服务器所在位置的数组,1代表有一个服务器,0代表没有 若多个服务器,在一行or在一列,则说这些服务器互相连接。 求互相连接的服务器有多少台。 Example 1: Input: grid = [[1,0],[0,1]] Output: 0 Explanation: No server 阅读全文
posted @ 2020-06-29 13:01 habibah_chang 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 问题: 给出一个数组,求至少拿出几个元素,使得他们出现的次数之和,>=总元素个数的一半 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 ··· 22 23 24 25 26 27 28 29 30 ··· 44 下一页