[
{ '00': 3.3406433795989217 },
{ '01': 7.371215599659567 },
{ '02': 8.216563231723296 },
{ '03': 6.168310325432516 },
{ '04': 3.5073431380070055 },
{ '05': 1.6104197237111348 },
{ '06': 0.6215879547521032 }
],
[
{ '10': 3.6824984689062354 },
{ '11': 8.276413244141352 },
{ '12': 9.393263752817953 },
{ '13': 7.174679043260096 },
{ '14': 4.146565482578415 },
{ '15': 1.9328356809373288 },
{ '16': 0.7563380262857585 }
],
[
{ '20': 2.097379162309316 },
{ '21': 4.796821176334703 },
{ '22': 5.534669783150271 },
{ '23': 4.2926916030788105 },
{ '24': 2.515879239794918 },
{ '25': 1.187567428237771 },
{ '26': 0.4699201039387404 }
],
[
{ '30': 0.8211845706155819 },
{ '31': 1.9075353125788463 },
{ '32': 2.2325407930142736 },
{ '33': 1.7539581905097126 },
{ '34': 1.0397854130494248 },
{ '35': 0.49576148435142064 },
{ '36': 0.19789157500581256 }
],
[
{ '40': 0.24773516000500195 },
{ '41': 0.5830691164647543 },
{ '42': 0.6904477295864787 },
{ '43': 0.5480588412313669 },
{ '44': 0.3278306643240631 },
{ '45': 0.15752158873111574 },
{ '46': 0.06329504444770173 }
],
[
{ '50': 0.061151126935764334 },
{ '51': 0.14545542986663187 },
{ '52': 0.17383966843362755 },
{ '53': 0.13909400923467197 },
{ '54': 0.08377178524032308 },
{ '55': 0.040486670771772315 },
{ '56': 0.016348423714773092 }
],
[
{ '60': 0.012806909587366471 },
{ '61': 0.030713983064227724 },
{ '62': 0.0369671174487187 },
{ '63': 0.029756524980091948 },
{ '64': 0.018012700795413502 },
{ '65': 0.008742842144856435 },
{ '66': 0.00354304640928744 }
]
]
I would like to sum the array values taking in consideration as the first array index all values greather than 0,
as second value I want sum the next key, eg:
[01] 3.68 + [21] 4.79 + [32] 2.23 + [43] 0.54 + [54] 0.08 + [65] 0.00
How can I implement this logic using EC6?
I though initially to create two loop, but is quite expensive in terms of performance
why is performance a concern?
to understand the question.. you want to sum the values? or keys + values? or both? :D
Обсуждают сегодня