Define calculateNumberOfStops function with logic for if startTrain and endTrain are the same.