- Java developer
- Junior
- 22 min
Scaled adjustment total
Moss Media stores signed whole-number adjustments. Return the sum of every adjustment multiplied by multiplier as a long. Each input is an int; the total fits in long. Do not narrow intermediate products.
Skills and rubricNumeric promotion before aggregation
- [50000,-10000,70000] at multiplier 50000 returns 5500000000. The negative item removes 500000000 from the sum.
- After each item, total equals the exact sum of the processed signed long products.
- An empty array returns 0; [2147483647] at multiplier 2 returns 4294967294.