about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 240
Copyright Nick Parlante 2017 - privacy