Preceding number list

Write a function @pre_number_list(n, f)@ that given an integer nn and a list of integers ff, returns the list formed by the numbers in ff that appear just before each ocurrence of nn in ff. The order of appearance of the numbers in the resulting list must preserve the original order.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T17:47:06.999Z

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