Sección 4. Capítulo 2
single
Challenge: Count Elements in an Iterator Range
Desliza para mostrar el menú
Tarea
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.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 4. Capítulo 2
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla