現在ITエンジニアとして働いていますが、コーディング・アルゴリズム力をもっと鍛えたいと思い、LeetCodeで学んだ内容をメモ的にアウトプットしています。 今回解いてみた問題は「560. Subarray Sum Equals K」です。 0番目: current_sum = 1, current_sum - k = -8(辞書に ...
A comparative C++ implementation of Kadane's Algorithm and a brute-force technique for finding the maximum subarray sum. This project includes: max-subarray-sum/ ├── src/ │ ├── kadane.cpp // ...
Create an array prefix_sum where each entry at index i stores the sum of all elements from the start up to index i. This can be computed as: prefix_sum[i]=prefix_sum[i−1]+nums[i] (ii) Answer Queries ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する