Code Room
Code reviewHard
Question
Review this C++ code holding a reference across map inserts.
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
#include <unordered_map>#include <string> void build(std::unordered_map<int, std::string>& m) { std::string& slot = m[1]; slot = "one"; for (int i = 2; i < 100000; ++i) { m[i] = std::to_string(i); } slot += "-final";}Run or narrate your approach, then ask the coach.