Code to find the longest run