Challenge: Generate and Transform Sequence
Compito
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.
Soluzione
solution.cpp
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 6
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me a real-world example?
Awesome!
Completion rate improved to 6.67
Challenge: Generate and Transform Sequence
Scorri per mostrare il menu
Compito
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.
Soluzione
solution.cpp
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 3. Capitolo 6
single