Invert values in Kotlin
The challenge
Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives.
The solution in Kotlin code
Option 1:
|
|
Option 2:
Option 3:
Test cases to validate our solution
|
|