Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Count Elements in an Iterator Range | Iterators with Algorithms
C++ STL Iterators
Sezione 4. Capitolo 2
single

single

bookChallenge: 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

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 2
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt