Replace instances of oldElement with newElement, and returns the number of replacements
Time complexity: O(n).
See Implementation
Replace instances of oldElement with newElement, and returns the number of replacements
Time complexity: O(n).