Zero To DSAZero To DSA
Privacy Policy路FAQ路Report a Bug路Support on Ko鈥慺i
Quadratic vs Linear

Space Complexity Analysis

medium

What is the space complexity (excluding input) of this function?

C#C#
int[] CopyArray(int[] arr) {
    var copy = new int[arr.Length];
    Array.Copy(arr, copy, arr.Length);
    return copy;
}

Examples

Input: n = 5