feat: add Swift codes for hash_map article

This commit is contained in:
nuomi1
2023-01-17 00:02:23 +08:00
parent a01841a20c
commit f0c54abb9a
5 changed files with 278 additions and 1 deletions

View File

@ -68,4 +68,10 @@ public enum PrintUtil {
showTrunks(p: p?.prev)
print(p!.str, terminator: "")
}
public static func printHashMap<K, V>(map: [K: V]) {
for (key, value) in map {
print("\(key) -> \(value)")
}
}
}