how to get the index of an element in an array kotlin code example
Example: how to get index of item in arraylist in kotlin
val b: List<Int> = a.mapIndexed { i, b -> if (b) i else null }.filterNotNull().toList()
val c: List<Int> = a.withIndex().filter { it.value }.map { it.index }