Sobes.tech
Junior — Senior

Restoring the original array values

livecode

Task condition

For each element of the original list of integers, add its smallest value, and name the resulting list nums. You need to implement the function restore_values() that takes a single parameter: • nums — a non-empty array of integers (length does not exceed 10^3). The function should return an array with the numbers that were in the list before the change.

Example 1: Input: print(restore_values([5, 9, 4, 7, 8])) Output: [3, 7, 2, 5, 6]

Example 2: Input: print(restore_values([2, 3, 4, 5, 6, 7, 8, 9, 10])) Output: [1, 2, 3, 4, 5, 6, 7, 8, 9]

Restoring the original array values - Live Coding… - sobes.tech