about | help | code help+videos | done | prefs |
public int getLastElement1(int[] list)
public int getLastElement(int[] numberList) { int len = numberList.length; int last = numberList[len-1]; return last; } getLastElement1([1, 2, 3, 4, 5]) → 5 getLastElement1([5, 10, 15, 20]) → 20 getLastElement1([3, 6, 9]) → 9 ...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: 1
Copyright Nick Parlante 2017 - privacy