Section 4. Chapitre 2
single
Challenge: Count Elements in an Iterator Range
Glissez pour afficher le menu
Tâche
Swipe to start coding
Implement count_in_range to return the number of elements in a std::vector<int> iterator range.
- Signature:
int count_in_range(std::vector<int>::iterator first, std::vector<int>::iterator last). - The range is [first, last).
- Use
std::distance. - Do not use loops, indexing, or
.size(). - Return the element count.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 4. Chapitre 2
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion