Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftgenerics and constraintsSingle-choice MCQ

Given retroactive conformance and a constrained extension, which call is valid?

extension Array where Element: Comparable { func isSorted() -> Bool { zip(self, self.dropFirst()).allSatisfy { $0 <= $1 } } } let a = [3, 1, 2].isSorted() let b = [(1, 2), (3, 4)].isSorted()