← Back to archive

Stdle #9 · containers · 2026-06-15

What does this C++ snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <iostream>
#include <unordered_set>
int main() {
std::unordered_set<int> s = {1, 2, 3};
std::cout << s.count(2) << " " << s.count(9) << "\n";
}
Containers
4 attempts left

Answer & explanation