zetaminusone's blog

By zetaminusone, history, 4 years ago, In English

Let there be a sequence of integers $$$x_1, x_2, ... x_n$$$. Then, the harmonic mean is defined as

$$$\frac{n}{\sum_{i=1}^n \frac{1}{x_i}}$$$

Given an array of positive and negative integers, what is the most efficient way to find the subarray with the maximum harmonic mean? Thanks!

Full text and comments »

  • Vote: I like it
  • +13
  • Vote: I do not like it