Articles by Tag #prefixsum

Browse our collection of articles on various topics related to IT technologies. Dive in and explore something new!

Maximum product subarray

Problem TC: O(n)O(n)O(n) SC: O(n)O(n)O(n) Using prefix and suffix array class...

Learn More 0 0Sep 30 '24

Count vowel strings in ranges

Problem TC: O(n) for calculating the prefix[] and O(k) for getting all the counts of the vowels in...

Learn More 0 0Jan 2

No of ways to split Array

Problem TC: O(n) for calculating prefix sum, and O(n) for iterating over the prefix sum for...

Learn More 0 0Jan 3

Apply Prefix Sum into solve sum of sub-array problem

In progress ...

Learn More 0 0May 19 '24

Count (*) between pipes (|)

Problem Statement: Count Stars Between Pipes Problem Description You are given...

Learn More 0 0Jan 18

Range Sum Query - Immutable

Problem TC: O(n) for calculating the prefix sum and O(1) for getting the sum of the subarray in the...

Learn More 0 0Jan 2

Grid Game

Problem TC: O(n) SC: O(n) class Solution { public long gridGame(int[][] grid) { long...

Learn More 0 0Jan 23

Sum of variable length subarray

Problem TC: O(n) SC:O(n) class Solution { public int subarraySum(int[] nums) { int...

Learn More 0 0Jan 20