Start empty; commands add/remove/contains return bool, floor returns greatest key<=query or absence. One result per command; unknown op throws invalid_argument. Result is variant<bool,Int,monostate>, where monostate is absent floor. Prototype unsorted unique list; final implement BST deletion/floor. Preserve commands.
Public signatures:
Vec<std::variant<bool,Int,std::monostate>> prototype(const Vec<std::pair<std::string,Int>>& commands);
Vec<std::variant<bool,Int,std::monostate>> solve(const Vec<std::pair<std::string,Int>>& commands);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.