100 Days Of Solidity, Assembly Math, Solidity Academy.
gas-efficient loops. // Assembly loop to calculate the sum of an array function sumArray(uint256[] memory data) public pure returns (uint256) { assembly { let len := mload(data) let sum := 0 for { let i := 0 } lt(i, len) { i := add(i, 1) } { sum := add(sum, mload(add(data, add(0x20, mul(i, 0x20))))