Challenge: Generate and Transform Sequence
Tarea
Swipe to start coding
Implement two functions:
generateSequence: takes an integernand returns astd::vector<int>of sizenfilled with random values. Usestd::generateto fill the vector. Generate random integers between 1 and 100 (inclusive).squareElements: takes aconst std::vector<int>&and returns a new vector where each element is the square of the corresponding input value. Usestd::transformfor this operation.
Solución
solution.cpp
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 6
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Awesome!
Completion rate improved to 6.67
Challenge: Generate and Transform Sequence
Desliza para mostrar el menú
Tarea
Swipe to start coding
Implement two functions:
generateSequence: takes an integernand returns astd::vector<int>of sizenfilled with random values. Usestd::generateto fill the vector. Generate random integers between 1 and 100 (inclusive).squareElements: takes aconst std::vector<int>&and returns a new vector where each element is the square of the corresponding input value. Usestd::transformfor this operation.
Solución
solution.cpp
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 6
single