Tag: prefix sum
Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences. After doing so, return the …
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: Output: 2 Explanation: is the longest contiguous …
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = , …
Given an array nums and a target value k, find the maximum length of a Contiguous subarray that sums to k. If there isn’t one, return 0 instead. The …
Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot index as the index where the sum of …