Iterative version segment tree not working for the question.

Revision en1, by Naveen_Kumar101, 2023-09-21 22:41:49

I was trying to solve a the question in Segment Tree section in Edu section (Segment Tree, Step2, Problem A) using iterative version of segment tree, but it's not working with it while the recursive version with the same logic works.

Could anyone please help with this? I am unable to find out where I am mistaking.

Code
Tags segment tree, range query

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Naveen_Kumar101 2023-09-21 22:55:08 1338 Tiny change: 'n }\n}\n<spoiler>\n' -> 'n }\n}\n</spoiler>\n' (published)
en1 English Naveen_Kumar101 2023-09-21 22:41:49 3587 Initial revision (saved to drafts)