Skip to content

Instantly share code, notes, and snippets.

@siosio
Created November 12, 2014 06:07
Show Gist options
  • Save siosio/4090db4d0cf4e17380f4 to your computer and use it in GitHub Desktop.
Save siosio/4090db4d0cf4e17380f4 to your computer and use it in GitHub Desktop.
こっちかなぁ
fun runs(a : IntArray) : Int {
return a.withIndices().count {
when (it.first) {
0 -> true
else -> a.get(it.first - 1) != it.second
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment