LeetCode 2529: Maximum Count of Positive Integer and Negative Integer ACERS Guide

Subtitle / Summary This problem is a compact exercise in boundary counting. Because the array is already sorted, you do not count negatives and positives one by one; you find where zero starts and where zero ends, then compute both counts from those boundaries. Reading time: 10-12 min Tags: binary search, counting, sorted array, boundaries SEO keywords: Maximum Count of Positive Integer and Negative Integer, LeetCode 2529, boundary counting Meta description: Use lower-bound and upper-bound binary search around zero to count negatives and positives in a sorted array, with correctness reasoning, engineering scenarios, and runnable implementations in six languages. Target Readers Learners practicing boundary search beyond exact-match lookup Engineers who count segments in sorted data Interview candidates learning how lower and upper bounds produce counts Background / Motivation The input is already sorted. That changes the problem completely. ...

March 18, 2026 · 9 min · map[name:Jeanphilo]

Hot100: Subarray Sum Equals K Prefix Sum + Hash Map ACERS Guide

Subtitle / Summary This is Hot100 article #1 for the series: Subarray Sum Equals K. We reduce the naive O(n^2) approach to O(n) with prefix sum plus a frequency hash map, then map the same pattern to real engineering scenarios. Reading time: 12-15 min Tags: Hot100, prefix sum, hash map SEO keywords: Subarray Sum Equals K, prefix sum, hash map, O(n), Hot100 Meta description: O(n) counting of subarrays with sum k using prefix sum + hash map, with complexity analysis and runnable multi-language code. Target Readers Hot100 learners who want stable reusable templates Intermediate engineers who want to transfer counting patterns to real data pipelines Interview prep readers who want to master prefix sum + hash map Background / Motivation “Count subarrays whose sum equals k” is one of the most classic counting problems. It appears in log analytics, risk threshold hits, and transaction sequence statistics. The two-loop brute force method is straightforward, but slows down quickly as input grows. So we need an O(n) method that scales. ...

February 9, 2026 · 9 min · map[name:Jeanphilo]

LeetCode 1512: Number of Good Pairs (Hash Counting ACERS Guide)

Subtitle / Abstract A basic counting problem: use frequency + combinations to drop O(n^2) to O(n). Includes engineering use cases and portable implementations. Reading time: 8-10 minutes Tags: hash-table, counting, array SEO keywords: Good Pairs, hash map, frequency Meta description: Hash counting solution for Good Pairs with complexity and code. Target readers Beginners learning hash tables and counting Engineers who want to map interview patterns to real stats tasks Interview prep for basic counting models Background / Motivation Counting equal pairs is a classic problem. A double loop is O(n^2). With frequency counting, you can solve it in linear time and scale to large data. ...

December 30, 2025 · 5 min · map[name:Jeanphilo]