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.
Yes. If the logical statement is never met then it would be an infinite loop. But in my case n would always equal to 0 at one point, so it terminates and return.
Replace
seen := make(map[string]int, len(gloves))
toseen := make(map[string]int)
in my solution, and you will get identical benchmark.If you think what I have done is considered "clever" I have bad news for you..
Go Translation
Go Translation
Go Translation
Thanks. I have fixed it.
@jcsahnwaldt I have tried to play around with the numbers. I have not been able to hit a mark where the O(N * Log K) beats the dump and sort solution. I have a feeling that we may timeout on generating such test cases before we can even do the tests.
I have enabled "Allow Contributors" flag, so others can chime in.
Thanks!
That was also my initial thought. However, I wanted to keep the Kata as close to its' origin as possible, since I have read on some other peoples translation feedback for other Katas, that some authors may insist on keeping the data types consistent between translations.
But your suggestion is fine with me. Just curious if Kata author may have any strong opinion about this.
Thanks! I did not know. Will do so moving forward.
Good catch. Fixed!
Go translation
Go translation
Go translation
Go translation
Loading more items...