Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
 Jeana
Approach 2: Using Hash Set - why is X added into unique_set?

Jeana

Nov 26, 2024

The problem didnt call for an item not found in the set to be added into the set.

The problem simply states to return if the set contains duplicates or not. This is very weird to me.

0

0

Comments
Comments
 Jeana
Jeanaa year ago

never mind i understood it finally haha

On this page

Problem Statement

Examples

Solution

Approach 1: Brute Force

Approach 2: Using Hash Set

Approach 3: Sorting