Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
What he meant was what if they are decimals.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
isn't filter suppose to take a callback function?
Your hash map have race condition.
T1: get value from hash map for username "Steve"
T2: get value from hash map for username "Steve" too
T1: set counter value for "Steve" to 1
T2: set counter value for "Steve" to 1
But this should be 2 and addings atomic long here not solve this problem. You should sync access to hash map or use concurrent hash map with atomic operations like 'compute'
very nice. I didn't think of that!
The problem stated they were non-negative integers and strings
And if it is not an integer ?
The first and second solutions are better .