values and two integers, rounds and factor.
Play rounds rounds. In each round, find the smallest number in the array and multiply it by factor, writing the result back in the same place. If the smallest value occurs more than once, pick the leftmost occurrence.
Return the array after all the rounds.values=[3, 1, 4, 1], rounds=3, factor=3 → [9, 3, 4, 3]
Round 1: the minimum 1 sits at positions 1 and 3, take the left one: [3, 3, 4, 1]. Round 2: the minimum 1 is at position 3: [3, 3, 4, 3]. Round 3: the minimum is 3, the leftmost one is at position 0: [9, 3, 4, 3].
values=[7, 2], rounds=2, factor=1 → [7, 2]
A factor of 1 changes nothing, so the array stays the same.
values=[5], rounds=4, factor=2 → [80]
values.length ≤ 100values[i] ≤ 100rounds ≤ 10factor ≤ 5values=[3, 1, 4, 1], rounds=3, factor=3
[9, 3, 4, 3]
Run checks the first 3 tests in your browser. Submit checks all 100 tests on the server, hidden ones included.