Opening your workspace…
Workspace/Coding room
Opening your workspace…
The mouse who minds the brewery biscuit tin has applied for a bigger tin. Her evidence is a list of visits. A positive entry records biscuits delivered, a negative entry records biscuits eaten, and a zero means someone just lifted the lid to sniff. The requisition form asks how many biscuits were delivered over all visits. Return that total, or 0 if there were no deliveries.
[4,-3,0,4]OUTPUT8Two deliveries of four biscuits make eight.
[-2,-5]OUTPUT0Both visits were snacks.
Which visits belong on the delivery form?
/** @param {number[]} visits * @returns {number} */ function solve(visits) { // Write your answer here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.
[4,-3,0,4]8