Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chashmeetsingh
Created June 29, 2020 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chashmeetsingh/a5cdc40943f4781d0176003271c56cf2 to your computer and use it in GitHub Desktop.
Save chashmeetsingh/a5cdc40943f4781d0176003271c56cf2 to your computer and use it in GitHub Desktop.
import Foundation
let a = [1,2,3,4,5,0]
extension Array where Element: Comparable {
func isSorted() -> Bool {
print(self.sorted() == self)
return true
}
}
a.isSorted()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment