GauthierPLM
12/13/2017, 1:34 PMmenegatti
12/13/2017, 1:34 PMmenegatti
12/13/2017, 1:35 PMyourList.subList(1, 4)
(toIndex is exclusive)karelpeeters
12/13/2017, 1:36 PMMutableList
and you mutate the resulting sublist the original will change too.GauthierPLM
12/13/2017, 1:39 PMGauthierPLM
12/13/2017, 1:45 PMval path = listOf(tour.toList().let {
it.subList(index, it.size)
}, tour.toList().subList(0, index)).flatten()
diesieben07
12/13/2017, 1:58 PMtour.toList()
, considering you are making the sub lists 0 to index and then index to size, which will span the whole list.
Right?menegatti
12/13/2017, 2:14 PMlistOf(1, 2, 3,4)
becomes listOf(3, 4, 1, 2)
karelpeeters
12/13/2017, 2:16 PMdiesieben07
12/13/2017, 2:16 PMasReversed
at the end.GauthierPLM
12/13/2017, 2:55 PMkarelpeeters
12/13/2017, 3:06 PM