New answers tagged hash-map
4
votes
Accepted
Implement a Python frozenmap
Library code cannot resort to global variable hacks. You are attempting to
implement a data structure. That's a bedrock kind of library code. As such, it
cannot resort to crazy mechanisms like setting ...
3
votes
Accepted
How do I increase the memory efficiency of this longest substring implementation? (C++)
Use a std::bitset
A std::unordered_map is inappropriate here. First of all, it stores keys and values, but you are not ...
2
votes
Sudoku puzzle solver for Leetcode
Your rotateBoard() method is merely performing "transposition" upon an indexed array of rows. This is a subject that I have somewhat recently conducted ...
1
vote
Porting PHP's array_push to Python
Some points to supplement @FMc's answer (though we'll put aside for the moment its excellent advice against mutation):
The way you compute keys when extending dictionaries can be tidied with ...
4
votes
Porting PHP's array_push to Python
The list case. As noted in a comment, you can simplify to this:
array.extend(args)
The dict case. It looks like the goal is to find the max integer key, if
any, ...
Top 50 recent answers are included
Related Tags
hash-map × 859python × 287
java × 165
performance × 127
c# × 117
c++ × 98
python-3.x × 70
c × 64
algorithm × 55
beginner × 49
strings × 43
array × 39
programming-challenge × 33
javascript × 31
python-2.x × 26
linked-list × 24
reinventing-the-wheel × 24
ruby × 23
collections × 22
sorting × 21
object-oriented × 19
comparative-review × 16
vba × 15
parsing × 14
csv × 14