Skip to content

Instantly share code, notes, and snippets.

@iaverypadberg
Created September 6, 2022 20:39
Show Gist options
  • Save iaverypadberg/4a37b789c46bcf0ef4115c32502339ff to your computer and use it in GitHub Desktop.
Save iaverypadberg/4a37b789c46bcf0ef4115c32502339ff to your computer and use it in GitHub Desktop.
Argsort in Kotlin
private fun argsort(needsSorting : Array<Int>){
val theRange = IntRange(0,needsSorting.size-1)
val idxs = theRange.toList().sortedBy { needsSorting[it] }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment