Jump to content

Compare a list of strings: Difference between revisions

→‎{{header|Kotlin}}: don't retain double negatives
(→‎{{header|Ring}}: remove off-topic code that compares single strings, not lists of strings)
(→‎{{header|Kotlin}}: don't retain double negatives)
Line 1,498:
fun areEqual(strings: Array<String>): Boolean {
if (strings.size < 2) return true
return (1 until strings.size).noneall { strings[it] !== strings[it - 1] }
}
 
fun areAscending(strings: Array<String>): Boolean {
if (strings.size < 2) return true
return (1 until strings.size).noneall { strings[it] <=> strings[it - 1] }
}
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.