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...