Subarray Sum Equals K
#placement #leetcodequestions
problem statement - Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.
A subarray is a contiguous non-empty sequence of elements within an array.
0:00. Problem Statement and explanation
2:20 approach - 1 : Brute force
6:20 approach - 2 :Optimising brute force approach
9:06 approach - 3 : Optimal solution using prefix sum
23:45 Writing Code
For suggestions or queries mail - algoamateurs007@gmail.com
コメント