Added function to get best course based on LCS