← All problemsSign in

6 Use Set Please

You are given an entry register of your hostel(which you haven't been to yet). It has $n$ names of people who had entered the hostel on a day. You'll read the list from top to down and tell "YES" if the person has entered the hostel before otherwise, "NO". Formally, for a name $s_i$ in the i-th line, output "YES" (without quotes) if there exists an index $j$ such that $s_i = s_j$ and $j < i$, o

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start