Challenge: Functional Programming Basics
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 3. Kapitel 2
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me a real-world example?
Großartig!
Completion Rate verbessert auf 5.56
Challenge: Functional Programming Basics
Swipe um das Menü anzuzeigen
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 3. Kapitel 2
single