Fraudulent Activity Notifications

  • + 4 comments

    No, 1 is correct - the threshold is twice the median of the previous 3 entries -

    for 40, the median of 10, 20, 30 is 20, so 40 is >= 2 * 20

    for 50, the median of 20, 30, 40 is 30, and 50 < 2 * 30

    Having said that, I reckon this is closer to a Hard than a Medium problem. Getting the correct answer is easy, but I'm so far unable to get the performance I need.