DSA · Big O & problem solving
Turn the prompt into a contract
Before choosing a data structure, restate the task and clarify the input: can it be empty, can values repeat, can values be negative, and what are the largest possible sizes?
Also clarify the output for ambiguous cases. Small examples expose details that the prose can hide.