easyArrays & HashingPure DSA~10 min
Duplicate Tab Detector
A browser extension warns the user when the same URL is opened in two or more tabs. Given the list of currently open tab URLs, return true if any URL appears more than once.
Problem
Given a list of strings urls, return true if any string appears at least twice; otherwise return false.
Input
An integer n (0 ≤ n ≤ 10^5) and a list of n URL strings (each up to 2048 chars).
Output
A single boolean.
Constraints
- 0 ≤ n ≤ 100,000
- URLs are compared as exact strings (no normalisation)
- Empty list returns false (vacuously no duplicates)
Examples
Example 1
Input
["a.com", "b.com", "a.com"]
Output
true
a.com appears twice.
Example 2
Input
["a.com", "b.com", "c.com"]
Output
false
All distinct.