class MyClass:UIViewController{
var myArr = ["John", "Eugene", "George", "John", "Lucy", "George"]
var myArr2 = ["28 years old", "20 years old", "30 years old", "28 years old", "18 years old", "30 years old"]
var myArr3 = ["3rd Avenue", "Long Beach rd.", "Hollywood Blvd.", "3rd Avenue", "5th street", "Hollywood Blvd."]
viewDidLoad(){
super.viewDidLoad()
removeRepeatedStringsFromArrays(myArr, [myArr2, myArr3])
}
func removeRepeatedStringsFromArrays(keyArray: [String], valuesArrays: [[String]]) -> [[String]]{
//do the func and I want myArr to be changed directly in func like:
keyArray = myArr.withoutRepeats
//and other arrays to be returned with removed repeated indexes from keyArray indexes
}
}
Expected results after code execution:
myArr = ["John", "Eugene", "George", "Lucy"]
myArr2 = ["28 years old", "20 years old", "30 years old", "18 years old"]
myArr3 = ["3rd Avenue", "Long Beach rd.", "Hollywood Blvd.", "5th street"]
Can the function changes myArr2 and myArr3 inside the function or I have to return them in [[String]] and do this:
myArr2 = removeRepeatedStringsFromArrays(myArr, [myArr2, myArr3]).0
myArr3 = removeRepeatedStringsFromArrays(myArr, [myArr2, myArr3]).1
?
