Created
June 29, 2020 19:24
-
-
Save chashmeetsingh/a5cdc40943f4781d0176003271c56cf2 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
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