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

 

list_furtherAway


Given a list of integers, make every element further away from zero. If the number is positive, add one to it. If the number is negative, subtract one from it. If the number is zero, leave it alone.


list_furtherAway([-1, 0, 1]) → [-2, 0, 2]
list_furtherAway([1, 2, 3, 4]) → [2, 3, 4, 5]
list_furtherAway([-5, -2, 0, 2, 5]) → [-6, -3, 0, 3, 6]

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

public List<Integer> list_furtherAway(List<Integer> data) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy