DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Interview Prep Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Interview Prep
What's the fixed complexity of the hasCommonId function from Common Mistakes #1, and what's the fix's complexity?
A
Original O(n), fixed O(n) — no real difference
B
Original O(n * m) nested loop, fixed O(n + m) using a Set built from one list first
C
Original O(log n), fixed O(n)
D
Both are O(n²), the fix doesn't help
Check Answer