Sezione 4. Capitolo 2
single
Challenge: Count Elements in an Iterator Range
Scorri per mostrare il menu
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 4. Capitolo 2
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione