In swift, filter an array means a loop to determine each item available, so the time complexity is O(n) And find an index in an array is the same, time complexity is O(n) .count and equal operation is all constant, so they are O(1)
So the total time complexity is O(n^2)