Challenge: Functional Programming Basics
Tarefa
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 2
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 5.56
Challenge: Functional Programming Basics
Deslize para mostrar o menu
Tarefa
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 2
single