Join numbers left to right when one ends with the digit the next one starts with, and find the longest joined string that begins and ends with the same digit.
Join numbers left to right when one ends with the digit the next one starts with, and find the longest joined string that begins and ends with the same digit.
Opens with the full question.