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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Should have just divided the num by 10 each time
Best practices vote, well done.
std::map is actually O(logn) to find. A hashmap (std::unordered_map) would be what to use for efficiency
Thanks for your response, it's great to see the alternatives. I quite like the second way you suggested to keep it semi simple and on 2 lines.
Also I've bookmarked the gitter link for future
This comment is hidden because it contains spoiler information about the solution
wow. Sorry!
Fantastic streams practice for me to walk through these. Thankyou.
Please people, never vote 1 liners as best practice.
Beauty
Unless I've missed something in the specification, I think there's a problem with the tests (i'm in python).
I'm getting an issue where the array contains 2 identical words that do not mesh into eachother, but the algo insists that they do. This happens only in the random tests and it's only the following example (ratespricesdiscount is duplicated and does not mesh into ratespricesdiscount):
Input array:
['bookpencil', 'pencilpapertypewritercomputer', 'computersoftwarehardware', 'warehousestoragecrates', 'ratespricesdiscount', 'ratespricesdiscount', 'counterintuitive', 'vertigofallinghighup']
Output error message:
'failed to mesh' should equal 'pencilcomputerwareratesratespricesdiscountcountve'
Perhaps, but the naming and order is confusing and so should be voted as Clever instead of Best Practice.
Using a Set would be better here than an ArrayList, as the lookup for the contains() method is more efficient in Sets.
Obviously though it doesn't matter too much when there's only 5 elements in the collection.
Agreed. Lovely solution but abstract naming should never be used.
Loading more items...