Search
⌘K

Leetcode 1487. Making File Names Unique

Given an array of folder names, simulate creating them so that each duplicate gets the smallest positive integer suffix "(k)" to make it unique, and return the actual assigned names. The core challenge is efficiently finding the minimal k for collisions (including when names already contain parentheses) across up to 5×10^4 entries.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid April, 2026

Meta

Senior

Your account is free and you can post anonymously if you choose.