Skip to content

Instantly share code, notes, and snippets.

@fanjavaid
Created May 28, 2020 13:32
Show Gist options
  • Save fanjavaid/f610be16f4dae6d7cbeb8016cc92df76 to your computer and use it in GitHub Desktop.
Save fanjavaid/f610be16f4dae6d7cbeb8016cc92df76 to your computer and use it in GitHub Desktop.
Coba coba
val length = sources.size
var lastComparisonIndex = 0
var curr = 0
var i = 0
while (lastComparisonIndex < length) {
try {
if (curr % length == 0) curr = 0
if (i > 0 && i % length == 0)
lastComparisonIndex++
distanceAlt(sources[curr], sources[lastComparisonIndex])
i++
curr++
} catch (e: Exception) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment