Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //08. Magic Sum
- function magicSum(arr, n) {
- 'use strict'
- for (let i = 0; i < arr.length; i++)
- for (let j = i + 1; j < arr.length; j++)
- if (arr[i] + arr[j] === n)
- console.log(`${arr[i]} ${arr[j]}`)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement