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

 

test2021_12_15_APSLHL_flipper


Return an array identical to 'nums' except with all the signs "flipped". So a negative becomes a positive and a positive becomes a negative. Zero is unsigned so remains zero either way. Note that the 'nums' array can have any number of elements, including being empty. Look at the test data for examples.


test2021_12_15_APSLHL_flipper([5, -7, 2, 0, -8]) → [-5, 7, -2, 0, 8]
test2021_12_15_APSLHL_flipper([]) → []
test2021_12_15_APSLHL_flipper([6]) → [-6]

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

public int[] test2021_12_15_APSLHL_flipper(int[] nums) { }

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: 240

Copyright Nick Parlante 2017 - privacy