Ad
  • Custom User Avatar

    That's my understanding as well

  • Custom User Avatar

    D is actually a Least Common Multiplier, not a common denominator.

    In fact D (in Rust an in some other languages) is a "Least Common Denominator" hence a common denominator.

    So I read the title and skimmed through the description ... and thought "okay, it's just reducing fractions" ... I read the example and it looked like the exact opposite

    "Réduire des fractions au même dénominateur" is misleading: "reduced fractions" don't have necessary a "smaller" denominator.

    D is quite large and I didn't notice it was the same ... reading the Discourse here I'm not the only one to find this description confusing

    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.

  • Custom User Avatar

    The title is "Common Denominators". The word common shows clearly that it has to be the same for all elements!
    Moreover you have below:

    You have to produce a result in the form:
    
    (N_1, D) ... (N_n, D) 
    or
    [ [N_1, D] ... [N_n, D] ] 
    or
    ...
    

    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.

  • Custom User Avatar

    @ThibaultLemaire: Now, it worked. Could you please check again.

  • Custom User Avatar

    then don't resolve the issue before you update the version.

  • Custom User Avatar

    You're right. But at the moment it is not possible to update because of an error of codewars...

  • Custom User Avatar

    Better to better your solution...

  • Custom User Avatar

    OK I know that since long but 1089 guys (out of 17631) have passed the C++ kata so nothing can be changed (limit for changing is 500 at CW).

  • Custom User Avatar

    If this weren't a 9 line, self-contained function maintainability might be more of a concern than efficiency.
    But that would beg the question "Why isn't that its own function?"

    I would certainly include comments with this code, but I stick by it!