I'm learning algorithms and data structures, I'm on a question that returns a array and squares it. sortedSquares is the variable name.
Recently, I looked up what it meant and I got a result that said that it was just a array that repeats zeros, but it seems like I could just use sortedSquares = [] with similar effect.
AlgoExpert is the platform that I'm using, so I cant upload all the code because of copyright stuff.
P.S. -- I'm 2 weeks into learning swift and any help would be great...thanks.
var sortedSquares = array(repeating: 0, from: array.count, by: 1)
var sortedSquares = [], thensortedSquaresis an Empty array... PrintArray(repeating: 0...). Depending onarray.countit could also be an empty array...array(repeating: 0, from: array.count, by: 1)isn’t the actual code. Please show the actual, code. (or that’s really it, it’s using a function you haven’t shown us, which you would need to do)