S
Jan 20, 2025Sum of variable length subarray
Problem TC: O(n) SC:O(n) class Solution { public int subarraySum(int[] nums) { int...
Jan 20, 20251 min read0 reactions0 comments
Tag archive
Problem TC: O(n) SC:O(n) class Solution { public int subarraySum(int[] nums) { int...
Problem Statement: Count Stars Between Pipes Problem Description You are given...
Problem TC: O(n) for calculating prefix sum, and O(n) for iterating over the prefix sum for...
Problem TC: O(n*m) for creating the prefix[][] sum matrix, O(row1+row2) for calculating the sum of...
Problem TC: O(n) for calculating the prefix[] and O(k) for getting all the counts of the vowels in...