Render Slot Budget

Company: Deutsche_Graduate_Analyst__IITK

Difficulty: medium

Problem Statement

Render Slot Budget Problem Description A rendering service works through a playlist of clips using two identical memory slots. The clip at the front of the playlist is loaded into one slot and the clip behind it into the other. From then on, every time a clip finishes and frees its slot, the next clip still waiting on the playlist is loaded into the slot that has just been freed. Clips finish in the order they were loaded, so the clips held in memory at any instant are either one clip on its own or two clips that stand next to each other on the playlist. The service can hold at most B megabytes of clip data in memory at one time. Before a clip is loaded you may drop it from the playlist: a dropped clip is never rendered, and the clips that remain keep their relative order. Report the smallest number of clips you have to drop so that the memory in use never passes B . What the loading order implies Two rules follow from the schedule, and both must hold for the clips you keep: The first