Tagged articles
5 articles
Page 1 of 1
IT Services Circle
IT Services Circle
Sep 8, 2025 · Fundamentals

How to Count Subarrays with Sum K Using Prefix Sum and HashMap

This article first highlights Ctrip's employee benefits, then presents the LeetCode 560 subarray sum problem with detailed explanations and multi-language implementations using prefix sum and hash map, including Java, C++, Python, and TypeScript solutions, and discusses time and space complexities.

CJavaLeetCode
0 likes · 6 min read
How to Count Subarrays with Sum K Using Prefix Sum and HashMap
php Courses
php Courses
Apr 8, 2025 · Backend Development

Applying Prefix Sum Technique in PHP for Efficient Subarray Sum Queries

This article explains the concept of prefix sums, demonstrates how to build and use a prefix‑sum array in PHP with clear code examples, and discusses when the technique is advantageous and its limitations, enabling O(1) interval sum queries after an O(n) preprocessing step.

BackendPHPPrefix Sum
0 likes · 10 min read
Applying Prefix Sum Technique in PHP for Efficient Subarray Sum Queries