Created
January 15, 2017 20:47
-
-
Save iscrz/97732b9526d019884debc0c0f92aa7d4 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
extension Array where Element : Comparable { | |
func sorted(after element: Element) -> [Element] { | |
return self.sorted { (a, b) -> Bool in | |
if a >= element && b < element { | |
return a > b | |
} | |
return a < b | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment