Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let sum = 0;
- for(let i = 0; i < input.length; i++ ){
- Number(input[i]) % 2 === 0 ? sum += Number(input[i]) : sum -= Number(input[i]);
- }
- console.log(sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement