FastPrepMinimum Frames for Equal Chunks
Problems/Minimum Frames for Equal Chunks

Minimum Frames for Equal Chunks

The D.E. Shaw Group logoThe D.E. Shaw Group● EasyOA
QuestionFunctionExamples

Problem statement

You are given an array dataframes of positive integers. Each value represents the size of one dataframe.

For every dataframe, its final size must be divisible into at least two chunks of equal positive size. You may add frames to a dataframe. Return the minimum total number of frames that must be added across all dataframes.

The source sample shows that values already divisible into two equal chunks need no extra frames, while 1 and 5 each need one added frame.

Function

minimumFramesForEqualChunks(dataframes: int[]) → int

Examples

Example 1

dataframes = [1,6,8,2,5]return = 2

6, 8, and 2 can already be divided into two equal chunks. Add one frame to 1 and one frame to 5, so the answer is 2.

More The D.E. Shaw Group problems

  • Koko Eating BananasPHONE SCREEN · Seen Nov 2026
  • Sum of Smallest Non-DivisorsPHONE SCREEN · Seen Nov 2026
  • Count Lucky TicketsOA · Seen Nov 2026
All The D.E. Shaw Group interview questionsSee The D.E. Shaw Group hiring insights
Saved
public int minimumFramesForEqualChunks(int[] dataframes) {
  // write your code here
}
Checking account…