Ad
  • Custom User Avatar

    Whatever this kata improves, it was much mor fun to solve it, than boring "code all day to get an one digit answer" katas.
    I really glad that this kata exists, it's just fresh air and why I prefer Codewars to Leetcode and other.

  • Custom User Avatar

    You're calculating the "sample variance" while the "population variance" is required. I think the link in the notes includes the explanation on how to get the expected result.

  • Custom User Avatar

    Can you elaborate please? What do you mean divide by n ? What is n

  • Custom User Avatar

    They want the population variance (divide by n). The larger number is the sample variance, corresponding to a denominator of n - 1.

  • Custom User Avatar

    I don't get why is variance("London", data) == 57.42(833333333374) while MATLAB shows me 62.649 - I also get this value by using 1/n * sum((x_i - m)^2). What's wrong? What am I missing here?