leetcode.cn 2023-07-21
🔴1499.max-value-of-equation
🏷️ Tags
#queue #array #sliding_window #monotonic_queue #heap_priority_queue
🔴1499.max-value-of-equation
🏷️ Tags
#queue #array #sliding_window #monotonic_queue #heap_priority_queue
Telegraph
max-value-of-equation
给你一个数组 points 和一个整数 k 。数组中每个元素都表示二维平面上的点的坐标,并按照横坐标 x 的值从小到大排序。也就是说 points[i] = [xi, yi] ,并且在 1 <= i < j <= points.length 的前提下, xi < xj 总成立。 请你找出 yi + yj + |xi - xj| 的 最大值,其中 |xi - xj| <= k 且 1 <= i < j <= points.length。 题目测试数据保证至少存在一对能够满足 |xi - xj| <= k 的点。…
leetcode.com 2023-08-16
🔴239.sliding-window-maximum
🏷️ Tags
#queue #array #sliding_window #monotonic_queue #heap_priority_queue
🔴239.sliding-window-maximum
🏷️ Tags
#queue #array #sliding_window #monotonic_queue #heap_priority_queue
Telegraph
sliding-window-maximum
You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return…