Created
April 2, 2018 03:36
-
-
Save GlennReilly/f68c7a7841115a14837f84244d410cd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun isAscending(list: List<Int>):Boolean { | |
return list.let { | |
var tempResult = true | |
it.forEachIndexed { idx, item -> | |
tempResult = if (idx != it.lastIndex) item < it[idx + 1] else true | |
if (!tempResult) return@let tempResult | |
} | |
tempResult | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment