This problem taught you when sets shine: anytime you need to count unique elements. The set's automatic deduplication turns a potentially complex counting problem into a simple insertion loop.
I showed you how data structure choice affects code clarity. Manual uniqueness checking requires nested loops and conditional logic. Sets give you the same result in fewer lines with better time complexity.
You learned to recognize the pattern: when the problem asks for distinct or unique elements, reach for a set. This pattern appears in character counting, removing duplicates, and checking membership.