Calculate the variance of a sequence of numbers.
Time complexity: O(n)
Space complexity: O(1)
Values to use in the calculation
The mean of values, will be calculated if not provided
values
The variance of values
Math
variance([1, 2, 3]); // 1 Copy
variance([1, 2, 3]); // 1
Calculate the variance of a sequence of numbers.
Time complexity: O(n)
Space complexity: O(1)