Word Replacement

Write a function replace(ws,x,y)replace(ws, x, y) that given a list of words wsws, and two words xx and yy, replaces all occurrences of xx in wsws with yy. The function must return two lists: The original list ws and the modified list with the replaced elements (if any).

Problem information

Author: ProAl1 professors

Generation: 2026-01-25T16:48:47.096Z

© Jutge.org, 2006–2026.
https://jutge.org