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