slow and fast to head.fast two steps and slow one step at a time until fast reaches the end of the list, which places slow at the midpoint.slow.head and the reversed second half with prev (the result of the reversal), calculating the twin sums.