Find Pivot Index prefix sum problem

Leetcode Problem: Find Pivot Index In our previous post, we solve one problem with prefix sum and now in this, we are again going to solve a problem. Given an array of integers nums, write…

Prefix Sum problem

Problem Statement Given an array of integers and an integer k. Find the total number of continuous subarrays whose sum equals k. Solve this problem using a prefix sum.Example 1:Input:nums = [1,1,1], k = 2Output:…

Prefix Sum in Array

In Previous post we already discuss about sliding window technique and problem, in this post we are going to know about prefix sum technique in array Let us Consider an example, we are given an…