about | help | code help+videos | done | prefs |
sum3Elem
Given an array of ints with odd length, return the sum of the first, middle, and the last element of the array. If the length of the array is less than 3, return the sum of all elements inside the array. sum3Elem([1, 2, 3]) → 6 sum3Elem([1]) → 1 sum3Elem([1, 0, 4, -2, 3]) → 8 ...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: 120
Copyright Nick Parlante 2017 - privacy