Skip to content

Commit f83d8c5

Browse files
committed
Runtime: 1004 ms (Top 5.08%) | Memory: 28.1 MB (Top 35.29%)
1 parent 24c5889 commit f83d8c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/M/Making File Names Unique/Making File Names Unique.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
# Runtime: 1004 ms (Top 5.08%) | Memory: 28.1 MB (Top 35.29%)
12
class Solution:
23
def getFolderNames(self, names: List[str]) -> List[str]:
34
# Hashmap will store the name as key and the number of times that name has duplicated so fas as value.
45
hashmap = {}
5-
6+
67
for name in names:
78
modified = name
89
# Check whether the name has already been used
@@ -17,6 +18,6 @@ def getFolderNames(self, names: List[str]) -> List[str]:
1718
hashmap[name] = k
1819
# Store the modified {name} with 0 as it is not duplicated yet.
1920
hashmap[modified] = 0
20-
21+
2122
# Return the keys of hashmap as that would be the unique file names.
22-
return hashmap.keys()
23+
return hashmap.keys()

0 commit comments

Comments
 (0)