Last updated
Last updated
Given an array of strings names
of size n
. You will create n
folders in your file system such that, at the ith
minute, you will create a folder with the name names[i]
.
Since two files cannot have the same name, if you enter a folder name which is previously used, the system will have a suffix addition to its name in the form of (k)
, where, k
is the smallest positive integer such that the obtained name remains unique.
Return an array of strings of length n
where ans[i]
is the actual name the system will assign to the ith
folder when you create it.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= names.length <= 5 * 10^4
1 <= names[i].length <= 20
names[i]
consists of lower case English letters, digits and/or round brackets.