Challenge: Functional Programming Basics
Task
Swipe to start coding
Write a function apply_function_to_vector that takes a vector and a function as arguments, and applies the function to each element of the vector, returning the results.
- The function must accept two arguments: a vector (
vec) and a function (fun). - The function must apply
funto each element ofvec. - The function must return a vector containing the results.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 2
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 5.56
Challenge: Functional Programming Basics
Swipe to show menu
Task
Swipe to start coding
Write a function apply_function_to_vector that takes a vector and a function as arguments, and applies the function to each element of the vector, returning the results.
- The function must accept two arguments: a vector (
vec) and a function (fun). - The function must apply
funto each element ofvec. - The function must return a vector containing the results.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 2
single