Codenation Interview Question — Help Needed

Revision en2, by kstheking, 2020-07-28 05:44:52

So we had an Interview Question at Codenation, This is the question Question Image. I understand that we can do the update node and sum of values through segment trees but what I can't understand is how to find the aith beautiful number, can someone help me out please! Also the constraints of X in the question are below 10^5

Tags #segment-trees, #trees

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English kstheking 2020-07-28 05:44:52 78
en1 English kstheking 2020-07-28 05:28:00 435 Initial revision (published)