You are given an integer array planks, where each element represents the length of a plank.
You want to build a fence consisting of planks that all have the exact same length. To construct each plank for the fence, you may:
Use planks.
Combine planks, resulting in a plank whose length is the sum of their individual lengths.
Each original plank in planks can be used at most
Return the maximum number of equal length planks you can form.
Note: You do not need to use all the original planks from
planks.
Constraints:
planks.length
planks[i]
You are given an integer array planks, where each element represents the length of a plank.
You want to build a fence consisting of planks that all have the exact same length. To construct each plank for the fence, you may:
Use planks.
Combine planks, resulting in a plank whose length is the sum of their individual lengths.
Each original plank in planks can be used at most
Return the maximum number of equal length planks you can form.
Note: You do not need to use all the original planks from
planks.
Constraints:
planks.length
planks[i]