Problem · Math
Minimum Frames for Equal Chunks
Learn this problemProblem 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[]) → intExamples
Example 1
dataframes = [1,6,8,2,5]return = 26, 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.