Challenge: Generate and Transform Sequence
Uppgift
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.
Lösning
solution.cpp
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 6
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
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
Svep för att visa menyn
Uppgift
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.
Lösning
solution.cpp
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 6
single