Could someone help explain the problem? I don’t seem to understand the output for the sample case. Specifically, I don’t really get where they got the number 42 as the sum of the path lengths.

Could someone help explain this? Thanks in advance.

Problem link