Compute sum of minima with removals | Kneron Interview Question