Hi can i check with you, the reason for having 2 loop is it because you want to compare the first node with the second node and so on?

Thank you!