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.
That's my understanding as well
I believe this is better than sorting, but not sure?
With n the size of a single word, sorting is
O(n * log(n))
, whereas counting should be onlyO(n)
.In fact D (in Rust an in some other languages) is a "Least Common Denominator" hence a common denominator.
"Réduire des fractions au même dénominateur" is misleading: "reduced fractions" don't have necessary a "smaller" denominator.
Problem is: before coding, it is better to carefully read in order to clearly understand the task...
Unfortunately it is a quality badly shared. Skimming through the description saves you a few minutes to lose a lot more later.
Thanks for your post.
Okay, let me reformulate.
I know what a Greatest Common Denominator is, and that it's used to reduce a fraction. So I read the title and skimmed through the description and thought "okay, it's just reducing fractions", but then I read the example and it looked like the exact opposite: you start with a reduced fraction and arbitrarily unreduce it to a bigger fraction?? That's what I meant by "it doesn't make any sense". I should have added "to me", because missing that information, the exercise felt like nonsense. So I read the sample tests, and the description, again and again, but D is quite large and I didn't notice it was the same.
Now, this is just my experience, and yes I am probably to blame for sticking with my initial assumption and failing to notice the subtlety of the description, but reading the Discourse here I'm not the only one to find this description confusing. And indeed -- please don't take it personally but -- I've read clearer descriptions.
So, to sum it up:
I eventually realised my mistake and solved the Kata, so it's all the same to me, but I'm thinking about the people that'll come after me.
I'm not asking for much. Just adding something like the following would make it clearer imo:
The title is "Common Denominators". The word common shows clearly that it has to be the same for all elements!
Moreover you have below:
and everybody can see that
D
is the same for all elements.You take Rust. You should have seen in "Sample Tests" that in each test D was the same for all elements.
Please reword the description to make it clear that D should be the same for all elements.
Otherwise it doesn't make any sense and I spent way to too long figuring this out.
@ThibaultLemaire: Now, it worked. Could you please check again.
then don't resolve the issue before you update the version.
You're right. But at the moment it is not possible to update because of an error of codewars...
How to turn a top down approach into a naive approach... nice.
In F#, the actual and expected are reversed in test cases. It's a bit confusing when debugging
This comment is hidden because it contains spoiler information about the solution
That's not very constructive. What don't you like about it?
For example, I think your solution is pretty clean, but I don't consider the single-line initialization a good practice.
Better to better your solution...
This solution sucks a lot!
Loading more items...