Category
Get the harmonic mean of an array of numbers.
number
Time complexity: O(n)
Space complexity: O(1)
The array to calculate the mean of
The geometric mean of the array
Math
const array = [1, 4, 4];harmonicMean(array); // 2 Copy
const array = [1, 4, 4];harmonicMean(array); // 2
Get the harmonic mean of an array of
number
s.Time complexity: O(n)
Space complexity: O(1)