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.
Same problem as all the other users that upvoted here. Could you please do something about the problem?
This solution is wrong. I know that. Somehow I clicked on submit as a random solution by accident worked out. :(
Was still working on it.
I just wanted to leave a big thank you to the author (g964) for all his great C++ Kata's on number theory.
I learned quite a lot from them in coding as well as in math.
My check if a number is prime is exactly one line long and I have no timeout.
What you have to do to get a timeout in this is just beyond me.
I try to solve all katas below 6 kyu in one line that is why I came up with this.
Ah somehow in my solution the const was gone. I must have deleted it in my code. It is a bit strange that it is in my comment and I overlooked it.
With the const I have no problem with it. Sorry to bother you.
First I wanted to thank you for this kata its really interesting and I learned some cool stuff about factorials.
(Especially I have never thought about: "factorial number system provides a unique representation for each natural number"- which is nice. ;))
I have one suggestions for C++. The parameter in the starting definition of factString2Dec:
static long long factString2Dec(const std::string &str);
is passed by reference (&str), but in your testcases you give const char pointers to the function, this obviously does not work since you cannot modify them.
There is no documentation about the class Route that is apparently used.
I cannot access any of Route's data since I do not know how to access it.
I tried iterators, [] operators and different combinations of member function names as well as member variables to get to the data.
There is no way to guess this.
Also there is a bug in the function template to start from since it has string as return value for the function with the std:: missing.
Could you please tell me how to access Route? Or even better remove the shitty class and use a std::pair<std::string, std::string> or sth similar.
(C++) I also do not get it. According to the Note you should not make a copy of arr, but also not modify it.
I went through the first 15 solutions and there was not one solution that does not copy arr or sort arr itself in some way.
This is really misleading. The solution is definitely not kyu 7 if the note is followed.
I did not know that one can use boost in this task or in CW at all.
I actually learned this from this solution.
Seriously, this just defiles the whole problem as there is next to no mathematical thinking involved at all in using this predefined function.
Nevertheless quite clever to use boost.