CodingEasy
Print first and last occurrence for each key
Filed under Delhivery
The question
Given a list of name-value pairs, print only the first and last occurrence for each unique name in order. If a name appears only once, output just that occurrence.
No write-up yet. Related questions below have one.
Related Delhivery questions
Collected from public candidate posts and coding forums. Updated Nov 2026.