lexypaul13
(Mayowa Paul)
1
Is there a not in keyword in swift similar to what's found in python ?

Nevin
2
if !noduplist.contains(element) {
...
}
And you probably want noduplist to be a Set rather than an Array.
However, for the specific algorithm you describe, it may be preferable to use removeAll(where:), as in:
extension RangeReplaceableCollection where Element: Hashable {
mutating func removeDuplicates() {
var alreadySeen: Set<Element> = []
removeAll { !alreadySeen.insert($0).inserted }
}
}