Write `sum(uint256[] memory arr)` returning the total.
Required in your answer: for (arr.lengthtotal +=
Compiles with solc in your browser
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Sum {
function sum(uint256[] memory arr) external pure returns (uint256 total) {
// TODO for loop
}
}