上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 44 下一页
摘要: 问题: 给定一组坐标点,问这些坐标点是否在一条直线上。 Example 1: Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]] Output: true Example 2: Input: coordinates = [[1,1], 阅读全文
posted @ 2020-07-18 11:27 habibah_chang 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个有n排,每排10个位置的影院,已被预订座位列表。 求一个4人组要定在连续相邻座位的可能性有多少种。 其中对过道(3和4之间,7和8之间),将其中一个人分开的话,不算满足相邻条件。 Example 1: Input: n = 3, reservedSeats = [[1,2],[1,3 阅读全文
posted @ 2020-07-12 13:04 habibah_chang 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 问题: 给出一组餐厅各种参数的,餐厅排行榜, 根据用户提供的3个要求:Vegan-Friendly, Price ,Distance 过滤满足要求的餐厅,并按照餐厅排行榜排序,若排名ranking一样,则按照id排序(都是大的排在前面)。 Example 1: Input: restaurants 阅读全文
posted @ 2020-07-12 11:10 habibah_chang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个数组,求其中连续K个元素组成的子数组中,平均值>=Threshold的子数组个数。 Example 1: Input: arr = [2,2,2,2,5,5,5,8], k = 3, threshold = 4 Output: 3 Explanation: Sub-arrays [2 阅读全文
posted @ 2020-07-12 10:25 habibah_chang 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 问题: 给出多次,字母排名次的名次列表。 求的综合名次的结果。(如果两字母分值相同,则按照字母序排列) Example 1: Input: votes = ["ABC","ACB","ABC","ACB","ACB"] Output: "ACB" Explanation: Team A was ra 阅读全文
posted @ 2020-07-11 16:37 habibah_chang 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 问题: 求两个接口,使得, add接口,向列表中添加元素, getProduct(k)接口,可得最后添加的k个元素的乘积。 Example: Input ["ProductOfNumbers","add","add","add","add","add","getProduct","getProduc 阅读全文
posted @ 2020-07-11 14:49 habibah_chang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个数组,表示了每一个chip的所在位置。 有以下的移动规则: 1.每向左or向右移动2个单位,消耗为0 2.没向左or向右移动1个单位,消耗为1 求将所有chip都移动到同一个位置,消耗最小是多少? Example 1: Input: chips = [1,2,3] Output: 1 阅读全文
posted @ 2020-07-11 12:05 habibah_chang 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定数组,求其中两两元素对之差=数组中两元素之差的最小值的,元素对数组。 Example 1: Input: arr = [4,2,1,3] Output: [[1,2],[2,3],[3,4]] Explanation: The minimum absolute difference is 阅读全文
posted @ 2020-07-06 16:19 habibah_chang 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 问题: 给出某年某月某日,求该天是周几? Example 1: Input: day = 31, month = 8, year = 2019 Output: "Saturday" Example 2: Input: day = 18, month = 7, year = 1999 Output: 阅读全文
posted @ 2020-07-06 14:19 habibah_chang 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个二维数组, 求其中正方形区域,使得和<=阈值threshold的最长边长。 Example 1: Input: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold = 4 Output: 2 Expla 阅读全文
posted @ 2020-07-05 10:59 habibah_chang 阅读(129) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 44 下一页