leetcode.com 2023-12-21
🟡1637.widest-vertical-area-between-two-points-containing-no-points
🏷️ Tags
#array #sorting
🟡1637.widest-vertical-area-between-two-points-containing-no-points
🏷️ Tags
#array #sorting
Telegraph
widest-vertical-area-between-two-points-containing-no-points
Given n points on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the area. A vertical area is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The…
leetcode.cn 2023-12-22
🔴1671.minimum-number-of-removals-to-make-mountain-array
🏷️ Tags
#greedy #array #binary_search #dynamic_programming
🔴1671.minimum-number-of-removals-to-make-mountain-array
🏷️ Tags
#greedy #array #binary_search #dynamic_programming
Telegraph
minimum-number-of-removals-to-make-mountain-array
我们定义 arr 是 山形数组 当且仅当它满足:
leetcode.cn 2023-12-23
🟡1962.remove-stones-to-minimize-the-total
🏷️ Tags
#greedy #array #heap_priority_queue
🟡1962.remove-stones-to-minimize-the-total
🏷️ Tags
#greedy #array #heap_priority_queue
Telegraph
remove-stones-to-minimize-the-total
给你一个整数数组 piles ,数组 下标从 0 开始 ,其中 piles[i] 表示第 i 堆石子中的石子数量。另给你一个整数 k ,请你执行下述操作 恰好 k 次:
leetcode.cn 2023-12-24
🟡1954.minimum-garden-perimeter-to-collect-enough-apples
🏷️ Tags
#math #binary_search
🟡1954.minimum-garden-perimeter-to-collect-enough-apples
🏷️ Tags
#math #binary_search
Telegraph
minimum-garden-perimeter-to-collect-enough-apples
给你一个用无限二维网格表示的花园,每一个 整数坐标处都有一棵苹果树。整数坐标 (i, j) 处的苹果树有 |i| + |j| 个苹果。 你将会买下正中心坐标是 (0, 0) 的一块 正方形土地 ,且每条边都与两条坐标轴之一平行。 给你一个整数 neededApples ,请你返回土地的 最小周长 ,使得 至少 有 neededApples 个苹果在土地 里面或者边缘上。 |x| 的值定义为:
leetcode.cn 2023-12-26
🔴1349.maximum-students-taking-exam
🏷️ Tags
#bit_manipulation #array #dynamic_programming #bitmask #matrix
🔴1349.maximum-students-taking-exam
🏷️ Tags
#bit_manipulation #array #dynamic_programming #bitmask #matrix
Telegraph
maximum-students-taking-exam
给你一个 m * n 的矩阵 seats 表示教室中的座位分布。如果座位是坏的(不可用),就用 '#' 表示;否则,用 '.' 表示。 学生可以看到左侧、右侧、左上、右上这四个方向上紧邻他的学生的答卷,但是看不到直接坐在他前面或者后面的学生的答卷。请你计算并返回该考场可以容纳的同时参加考试且无法作弊的 最大 学生人数。 学生必须坐在状况良好的座位上。 示例 1: 输入:seats = [["#",".","#","#",".","#"], [".","#","#","#","#","."], …
leetcode.com 2023-12-27
🟡1578.minimum-time-to-make-rope-colorful
🏷️ Tags
#greedy #array #string #dynamic_programming
🟡1578.minimum-time-to-make-rope-colorful
🏷️ Tags
#greedy #array #string #dynamic_programming
Telegraph
minimum-time-to-make-rope-colorful
Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon. Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for…