You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var lastVal: Int?
let sortedNums = nums.sorted().filter { (val) in
if lastVal == nil {
lastVal = val
return true
}
if lastVal! == val {
return false
} else {
lastVal = val
return true
}
}
NEVERMIND! fails on [-1,-1,-1]
Would filtering the sorted array like this
allow us to get rid of this?
The text was updated successfully, but these errors were encountered: