Longest Shared Repeat Problem (formatting update)

Updated the formatting to write the general solution process as a
separate function.