about | help | code help+videos | done | prefs |
Write a method that returns the sum of the first and last elements in an array. As a precondition, you may assume that 'nums' will contain at least 2 elements. da2022_11_07_sumFirstLast([4, 2434, 64, 7, 3235, 1]) → 5 da2022_11_07_sumFirstLast([1, 2, 3, 4, 5, 6, 7]) → 8 da2022_11_07_sumFirstLast([-40, 35, 894, 4539, 241, 40]) → 0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy