Monday, January 15, 2024

Rust pop-quiz: init()

#Rust pop-quiz

write init(v: Vec<T>) -> Vec<T>

where, e.g.:

init([1,2,3,4]) -> [1,2,3]

GO!

init() of an infinite list is idempotent with that infinite list??? ... or should we not speak of such things? 😅

No comments:

Post a Comment