id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

stackHeadPlus8


If the stack's head is 8, return the stack unchanged. If the stack's head is not 8, change the head to have a value 8 more than it currently has.


stackHeadPlus8([8]) → [8]
stackHeadPlus8([2]) → [10]
stackHeadPlus8([1, 4, 9]) → [1, 4, 17]

...Save, Compile, Run (ctrl-enter)

public ArrayList<Integer> stackHeadPlus8(ArrayList<Integer> list) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 300

Copyright Nick Parlante 2017 - privacy