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

 

tmhscs@gmail.com stacks > stackHeadPlus8b
prev  |  next  |  chance

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. The stack may be empty.


stackHeadPlus8b([]) → [8]
stackHeadPlus8b([8]) → [8]
stackHeadPlus8b([2]) → [10]

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

public ArrayList<Integer> stackHeadPlus8b(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