Code Room
Code reviewHard
Question
Review this C++ loop meant to compare adjacent elements of a vector (it should do nothing for an empty vector).
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
for (size_t i = 0; i < v.size() - 1; i++) { if (v[i] > v[i + 1]) report(i);}Run or narrate your approach, then ask the coach.