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
Similar Kata:
Stats:
Created | Feb 7, 2017 |
Published | Feb 7, 2017 |
Warriors Trained | 229025 |
Total Skips | 13712 |
Total Code Submissions | 367196 |
Total Times Completed | 177837 |
Python Completions | 57220 |
JavaScript Completions | 62755 |
PHP Completions | 4185 |
Haskell Completions | 1366 |
C# Completions | 8630 |
Crystal Completions | 53 |
Ruby Completions | 3574 |
Java Completions | 16645 |
CoffeeScript Completions | 47 |
C++ Completions | 13367 |
C Completions | 4421 |
Elixir Completions | 501 |
NASM Completions | 79 |
Kotlin Completions | 1973 |
Racket Completions | 87 |
Dart Completions | 1454 |
Factor Completions | 42 |
Rust Completions | 2165 |
Julia Completions | 95 |
TypeScript Completions | 2252 |
R Completions | 250 |
D Completions | 22 |
RISC-V Completions | 30 |
Scala Completions | 200 |
Go Completions | 2171 |
Lua Completions | 93 |
Total Stars | 1044 |
% of votes with a positive feedback rating | 91% of 10542 |
Total "Very Satisfied" Votes | 8829 |
Total "Somewhat Satisfied" Votes | 1513 |
Total "Not Satisfied" Votes | 200 |
Total Rank Assessments | 21 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |