Having a case that a map is passed in with data like
Map<Pair<Int, Int>), String>
Pair<Int, Int>) // zero based star index, inclusive end index
to
displayString
when doing the process, need to pick up proper displayString for current position, like
var index = 0
for (data in dataList) {
/*
if the current index is within one of the pair<int, int>
then use the mapped displayString
*/
index++
}
what is best way to do in kotlin?