Relative Content

Tag Archive for javascriptarraysgoogle-apps-script

Finding the optimal division of an array

I’m trying to write a function in Apps Script to take a large array of values that I’d like to split as evenly as possible into subarrays of values (a array of arrays). Each subarray would optimally be 15 values long. The maximum number of values in each array would be 20 and the minimum number of values would be 10.