Help needed in a problem

Revision en1, by felix-felicis, 2021-08-11 17:52:37

Problem: Integers have friends.

After seeing the tutorial of this problem, I learnt about the sparse table. The tutorial though provides the method which is sparse table construction and then using binary search, I could not completely understand it. The comment section was pretty helpful but now the older comment section has been deleted. Can someone please explain what they have done( preferably an approach using sparse table because I have spent a lot of time learning it.)

If possible, please explain it in a beginner-friendly manner as I have never used a sparse table till now. It would really be helpful to me...


  Rev. Lang. By When Δ Comment
en1 English felix-felicis 2021-08-11 17:52:37 705 Initial revision (published)