8 kyu

Invert values

57,220 of 177,837user7657844

Description:

Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives.

[1, 2, 3, 4, 5] --> [-1, -2, -3, -4, -5]
[1, -2, 3, -4, 5] --> [-1, 2, -3, 4, -5]
[] --> []

You can assume that all values are integers. Do not mutate the input array.

Lists
Fundamentals
Arrays

Stats:

CreatedFeb 7, 2017
PublishedFeb 7, 2017
Warriors Trained229025
Total Skips13712
Total Code Submissions367196
Total Times Completed177837
Python Completions57220
JavaScript Completions62755
PHP Completions4185
Haskell Completions1366
C# Completions8630
Crystal Completions53
Ruby Completions3574
Java Completions16645
CoffeeScript Completions47
C++ Completions13367
C Completions4421
Elixir Completions501
NASM Completions79
Kotlin Completions1973
Racket Completions87
Dart Completions1454
Factor Completions42
Rust Completions2165
Julia Completions95
TypeScript Completions2252
R Completions250
D Completions22
RISC-V Completions30
Scala Completions200
Go Completions2171
Lua Completions93
Total Stars1044
% of votes with a positive feedback rating91% of 10542
Total "Very Satisfied" Votes8829
Total "Somewhat Satisfied" Votes1513
Total "Not Satisfied" Votes200
Total Rank Assessments21
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • user7657844 Avatar
  • jhoffner Avatar
  • Javatlacati Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • suic Avatar
  • PG1 Avatar
  • donaldsebleung Avatar
  • siebenschlaefer Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • ezcrypter Avatar
  • cwesnow2000 Avatar
  • PhoenixFireWolf Avatar
  • Voile Avatar
  • mitron6 Avatar
  • NunoOliveira Avatar
  • Souzooka Avatar
  • kdmatrosov Avatar
  • Camsbury Avatar
  • hobovsky Avatar
  • username0 Avatar
  • user8436785 Avatar
  • Ich5003 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
  • KayleighWasTaken Avatar
  • metatable Avatar
Ad