Reduce Memory Usage

Problem Overview

  • Given an array of process memory values and m, delete exactly m contiguous processes to minimize the remaining total memory; return that minimum.
  • Input: int[] processes, int m. Output: int minimal remaining memory after deletion.
  • Constraints (abridged): 1 < N, 1 < m < 100000, 1 < process[i] < 1e9.
  • Real-world context: Amazon Data Center memory optimization.
  • Amazon interviews: a coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: