https://app.codesignal.com/arcade/intro/level-6/mCkmbxdMsMTjBc3Bm
Given an array of integers, replace all the occurrences of elemToReplace with substitutionElem.
For inputArray = [1, 2, 1], elemToReplace = 1, and substitutionElem = 3, the output should be
solution(inputArray, elemToReplace, substitutionElem) = [3, 2, 3].