educative.io

Time complexity of Accounts Merge

“Sorting all the emails in each account takes O(nklognk).”

For each of n accounts, we sort up to k emails. Should it be O(nklogk)?


Course: Grokking Coding Interview Patterns in Python - AI-Powered Learning for Developers
Lesson: Solution: Accounts Merge - Grokking Coding Interview Patterns in Python