Given list of strings representing train station names implement a function which will return passenger friendly
String
:
Train is calling at
Train is calling at stationName
and
word.Challenge | Solution |
formatTrainRoute(listOf("Luton")) // "Train is calling at Luton"
formatTrainRoute(listOf("Luton", "Harpenden")) // "Train is calling at Luton and Harpenden"
formatTrainRoute(listOf("Luton", "Harpenden", "London")) // "Train is calling at Luton, Harpenden and London"