Help needed in a segment tree problem.

Revision en1, by Dontony, 2021-10-05 08:57:17

Q:You are given an array of n elements. Now, there are 2 types of queries on the array. 1) Change the element at index i to some new element(say x). 2)Given l and r ,find the number of subarrays in range l to r having sum divisible by 3. The number of queries can be upto 1e5 and also size of the array can be upto 1e5.

This is not from some ongoing coding contest. I found this question on gfg from a company's interview experience. Link to that blog:- https://www.geeksforgeeks.org/nutanix-interview-experience-for-mts-intern-off-campus-2021/

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Dontony 2021-10-05 08:57:17 589 Initial revision (published)