Results for “map”
Small, practical examples. Search by task or narrow things down below.
Remove a Map entry and detect whether it existed
TypeScript: Map.delete returns true only when an entry was present.
TypeScript✓ Tested
Remove a map entry and inspect the number removed
C++: erase by key reports whether a unique-key map contained the entry.
C++✓ Tested
Sort map keys for stable output
Sort map keys for stable output using a complete Go program with explicit sample inputs.
Go✓ Tested
Transform each value with map
Transform each value with map in a complete Rust program using the standard library.
Rust✓ Tested
Update an existing map value
Update an existing map value in a complete Rust program using the standard library.
Rust✓ Tested
Use a hash map for direct key lookup
C++: unordered_map provides key lookup without promising iteration order.
C++✓ Tested
Check whether all required keys exist
Python: Compare the required key set with a dictionary key view.
Python✓ Tested
Collect unique sorted values
Collect unique sorted values in a complete Rust program using the standard library.
Rust✓ Tested
Convert an object’s properties into a hashtable
PowerShell: Enumerate PSObject.Properties when the set of property names is known only at runtime.
PowerShell✓ Tested
Copy nested mutable data independently
Python: Use deepcopy when changes to nested lists must not affect the original object.
Python✓ Tested
Count repeated words
Count repeated words using a complete Go program with explicit sample inputs.
Go✓ Tested
Count values with the entry API
Count values with the entry API in a complete Rust program using the standard library.
Rust✓ Tested