Search⌘ K
AI Features

Finding MK Average

Finding MK Average manages a stream of integers: take its last m values, remove the k smallest and k largest, and return the rounded-down average of what remains, or -1 if fewer than m values exist.

Statement

You are given two integers, m and k, and a stream of integers. Your task is to design and implement a data ...