Each reached token must be exactly LOAD:<nonempty-label> or UNLOAD:<nonempty-label>, with exactly one colon. Malformed reached tokens throw invalid_argument. Return false immediately for an unload mismatch without inspecting later tokens; [] is true and unmatched loads at end are false. Prototype may reduce adjacent pairs; final uses a stack. Preserve tokens.
Public signatures:
bool prototype(const Vec<std::string>& tokens);
bool solve(const Vec<std::string>& tokens);Compile and run from this directory:
c++ -std=c++20 -O2 -Wall -Wextra -pedantic -pthread main.cpp -o practice
./practice --stage prototype
./practice --stage finalEdit exercise.hpp. Both stages start unfinished and must report failures until implemented. Keep main.cpp as the executable contract. The runner returns nonzero for a failed check, an unexpected exception, an invalid stage, or an empty suite. C++20 and only the standard library are required.
Complete the starter code, then run the checks.
Results and errors will appear here.
C++ runtime powered by Wasmer.