<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>数组 on Jeanphilo Blog</title><link>https://jeanphilogong.github.io/jeanblog/zh/tags/%E6%95%B0%E7%BB%84/</link><description>Recent content in 数组 on Jeanphilo Blog</description><generator>Hugo -- 0.168.0</generator><language>zh-cn</language><lastBuildDate>Sat, 10 Oct 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://jeanphilogong.github.io/jeanblog/zh/tags/%E6%95%B0%E7%BB%84/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode 1282：用户分组，从相同容量分桶到满组即输出</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/1282-group-the-people-given-the-group-size-they-belong-to/</link><pubDate>Sat, 10 Oct 2026 10:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/1282-group-the-people-given-the-group-size-they-belong-to/</guid><description>从用户编号与组大小的区别出发，先按容量收集再分块，逐步写出满组即输出的 Python 解法，解释列表引用陷阱、正确性与线性复杂度。</description></item><item><title>LeetCode 503：下一个更大元素 II，循环数组中的右侧到哪里结束</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/503-next-greater-element-ii/</link><pubDate>Mon, 20 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/503-next-greater-element-ii/</guid><description>从循环数组的严格下一个更大元素定义出发，先写可验证的环形扫描，再推导只压入一次原始索引的线性单调栈解法。</description></item><item><title>LeetCode 84：柱状图中最大的矩形，连续区间的高度由谁决定</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/84-largest-rectangle-in-histogram/</link><pubDate>Mon, 20 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/84-largest-rectangle-in-histogram/</guid><description>从连续区间的最矮柱限制出发，先构造枚举区间 baseline，再推导按柱高结算最大宽度的线性单调栈解法。</description></item><item><title>LeetCode 136：只出现一次的数字，如何在常量空间排除重复元素</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/136-single-number/</link><pubDate>Wed, 15 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/136-single-number/</guid><description>从集合配对 baseline 出发，推导 XOR 抵消重复元素，在线性时间和常量额外空间内解决 LeetCode 136。</description></item><item><title>LeetCode 739：每日温度，如何找到右侧第一个更高温度</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/739-daily-temperatures/</link><pubDate>Wed, 15 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/739-daily-temperatures/</guid><description>从向右扫描的 O(n²) baseline 出发，推导维护未解决日期的单调索引栈，在线性时间内解决 LeetCode 739 每日温度。</description></item><item><title>LeetCode 45：跳跃游戏 II，从可达边界升级到最少跳数</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/greedy/45-jump-game-ii/</link><pubDate>Wed, 08 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/greedy/45-jump-game-ii/</guid><description>从 LeetCode 55 的 farthest 可达边界出发，推导 LeetCode 45 跳跃游戏 II：用 current_end 表示当前跳数覆盖边界，用 farthest 表示下一跳最远覆盖，最终得到最少跳数贪心。</description></item><item><title>LeetCode 121：买卖股票的最佳时机，从历史最低价推出一次交易贪心</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/greedy/121-best-time-to-buy-and-sell-stock/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/greedy/121-best-time-to-buy-and-sell-stock/</guid><description>从买入必须早于卖出的顺序压力出发，推导 LeetCode 121 买卖股票的最佳时机：先写 O(n^2) 正确基线，再压缩成维护历史最低价的一次扫描贪心。</description></item><item><title>LeetCode 55：跳跃游戏，用最远覆盖范围判断能否到达终点</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/greedy/55-jump-game/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/greedy/55-jump-game/</guid><description>从会卡在 0 的失败样例出发，推导 LeetCode 55 跳跃游戏：先用 reachable 数组建立正确基线，再压缩成维护 farthest 最远覆盖范围的贪心。</description></item><item><title>Hot100：螺旋矩阵（Spiral Matrix）边界收缩模拟 ACERS 解析</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/54-spiral-matrix/</link><pubDate>Sun, 01 Feb 2026 13:55:22 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/54-spiral-matrix/</guid><description>用“边界收缩”在 O(mn) 时间输出矩阵的顺时针螺旋序列，附工程场景、易错点与多语言实现（Hot100）。</description></item><item><title>矩阵置零：用首行首列做标记实现原地 O(1) 空间（LeetCode 73）</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/73-set-matrix-zeroes/</link><pubDate>Sun, 01 Feb 2026 12:53:35 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/73-set-matrix-zeroes/</guid><description>把首行首列当作标记位，在不额外开集合的前提下原地完成矩阵置零；含思路推导、常见坑与多语言实现。</description></item><item><title>Hot100：缺失的第一个正数（First Missing Positive）原地索引定位 ACERS 解析</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/41-first-missing-positive/</link><pubDate>Sat, 24 Jan 2026 12:42:31 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/41-first-missing-positive/</guid><description>用原地索引定位在 O(n) 时间、O(1) 额外空间找到缺失的第一个正数，含工程场景与多语言实现。</description></item><item><title>Hot100：除自身以外数组的乘积（Product of Array Except Self）前后缀乘积 ACERS 解析</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/238-product-of-array-except-self/</link><pubDate>Sat, 24 Jan 2026 12:35:09 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/238-product-of-array-except-self/</guid><description>O(n) 时间、无需除法，用前后缀乘积求解除自身以外数组的乘积，含工程场景与多语言实现。</description></item><item><title>Hot100：轮转数组（Rotate Array）三次反转 ACERS 解析</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/189-rotate-array/</link><pubDate>Sat, 24 Jan 2026 12:29:42 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/189-rotate-array/</guid><description>用三次反转在 O(n) 时间完成轮转数组，含工程场景、常见误区与多语言实现。</description></item><item><title>LeetCode 42：一张高度图能接住多少雨水？</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/42-trapping-rain-water/</link><pubDate>Sat, 24 Jan 2026 10:27:35 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/42-trapping-rain-water/</guid><description>从单个位置出发，推导边界数组和 O(1) 空间的双指针解法，再把同一个边界模型迁移到单调栈。</description></item><item><title>固定间距 1 检测：一次扫描判断 1 之间至少 k 个间隔（LeetCode 1437）</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/1437-check-if-all-ones-are-at-least-k-places-away/</link><pubDate>Thu, 22 Jan 2026 09:12:14 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/1437-check-if-all-ones-are-at-least-k-places-away/</guid><description>用一次扫描判断所有 1 之间是否至少相隔 k 个位置，含工程场景、常见误区与多语言实现。</description></item><item><title>LeetCode 239：滑动窗口最大值</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/239-sliding-window-maximum/</link><pubDate>Sun, 18 Jan 2026 18:32:08 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/239-sliding-window-maximum/</guid><description>从完整窗口的边界出发，先实现正确的扫描解法，再推导出 O(n) 的索引双端队列解法。</description></item><item><title>数据结构基础：好数对计数（Number of Good Pairs）哈希统计 ACERS 解析（LeetCode 1512）</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/1512-number-of-good-pairs/</link><pubDate>Tue, 30 Dec 2025 11:40:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/1512-number-of-good-pairs/</guid><description>用哈希计数一遍扫描解决好数对（Good Pairs）问题，附工程场景、复杂度对比与多语言实现。</description></item><item><title>Hot100：Two Sum 两数之和哈希表一遍扫描与 ACERS 工程化解析（LeetCode 1）</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/1-two-sum/</link><pubDate>Sun, 28 Dec 2025 10:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/hot100/1-two-sum/</guid><description>从题意还原到哈希表一遍扫描，系统讲解 Two Sum，并给出工程场景、复杂度对比与多语言实现。</description></item><item><title>咒语与药水的成功组合：排序 + 二分查找秒杀乘积约束问题（LeetCode 2300）</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/2300-successful-pairs-of-spells-and-potions/</link><pubDate>Thu, 04 Dec 2025 10:50:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/2300-successful-pairs-of-spells-and-potions/</guid><description>给定 spells 和 potions 两个数组以及 success 阈值，如何用排序 + 二分查找在 O((n+m)log m) 时间内求出每个咒语能与多少药水形成乘积 ≥ success 的成功组合，并给出多语言实现与工程应用示例。</description></item><item><title>固定长度子数组 + 至少 m 个不同元素：几乎唯一子数组的最大和（LeetCode 2841）</title><link>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/2841-maximum-sum-of-almost-unique-subarray/</link><pubDate>Thu, 04 Dec 2025 10:40:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/zh/alg/leetcode/2841-maximum-sum-of-almost-unique-subarray/</guid><description>给定整数数组 nums 和正整数 m、k，要求在所有长度为 k、且至少包含 m 个不同元素的子数组中，找到最大和；若不存在返回 0。本文用滑动窗口 + 计数哈希表推导 O(n) 解法，并提供多语言实现与工程应用示例。</description></item></channel></rss>