Replacement of zeros

Write a function @replacement(f, g)@ that provided two integer lists ff and gg returns the list obtained after replacing the zeros in list ff with values in gg. First zero has to be replaced with the first number in gg, the second zero with the second number in gg and so on, until there are no more zeros in ff or there are no more available numbers in gg. When values in gg have been exhausted no more replacements are done. Lists ff and gg do not have to change.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T17:03:33.895Z

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