Osio 4. Luku 2
single
Challenge: Count Elements in an Iterator Range
Pyyhkäise näyttääksesi valikon
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 4. Luku 2
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme