Ad
  • Custom User Avatar

    This will also fail if there are ten total subversion numbers or more, e.g. [9, 10].sort() => [10, 9]

  • Custom User Avatar

    Makes no mention of invalid input in the description.

  • Default User Avatar

    You certainly know how to code in base 16. In base 16 we can't limit ourselves to digit from 0 to 9, we extend the "alphabet" with A to F.
    You could have a look at "Numeral System" in Wikipedia:

    http://en.wikipedia.org/wiki/Numeral_system
    http://en.wikipedia.org/wiki/Factorial_number_system

    Maybe I must had these references to the kata.

  • Custom User Avatar

    Sure, something along the lines of this would probably be a lot clearer on the alphabet thing:

    "(...) If our factorials are limited to 0!...9!, the biggest number we can code is 10! - 1.

    So we extend 0!...9! with the 26 letters in the alphabet, making 10! => Z and 35! => A. With these 36 digits we can code up to 36! − 1, or 37199332678990121746799944815083519999999910 (base 10).

    Examples:
    36288000 => A0000000000
    5239813538 => AB29453440100
    "

    The description does not really make the order clear, and the constraints are somewhat confusing. Maybe I'm just tired, but I actually feel like I still don't really understand exactly what the problem was asking for and my solution was wrong.

    The problem says that we are extending from 0!...9! to 0!...35! using the alphabet, but it is not really well explained why we are limited from 0! to 9! to begin with. The constraint is -implied-, but there's no real reason you shouldn't be able to go up to 99! or 1000! or whatever else. The constraints should be more explicit and ask for 0!...n! where n is not 35, as the number of letters in the alphabet is unrelated to how many factorials we choose to allow. It would make more sense to ask for a "Nice" number like 32! and just allow 0-9, A-Z as possible digits.

  • Default User Avatar

    Can you propose a better description?

  • Custom User Avatar

    Description does not clearly explain the requirements, very ambiguously written. Specifically needs more examples and a clarification of the alphabet addendum.

  • Custom User Avatar

    I'm sure this is not how this is meant to be solved, but I'll take it.

  • Custom User Avatar

    Testing description uses '%r' % r, should be '%r' % a.

  • Custom User Avatar

    Good question. Just a lack of familiarity with Javascript. I see also that I left a debugging line in there as well.

    jsperf shows Math.max is considerably faster:
    http://jsperf.com/max-vs-sort-performance

  • Default User Avatar

    Why did you choose

    [version1.length, version2.length].sort()[1]; 
    

    over the classical :

    Math.max(version1.length, version2.length);
    

    ?

  • Default User Avatar

    Still doing it to me. Edit: reloaded page and it worked

  • Custom User Avatar

    (issue resolved)

  • Custom User Avatar

    It's problem with test framework, I sometimes have this problem with different kata randomly (server overload maybe)

  • Custom User Avatar

    Successful solutions all timeout in Python.

    Edit: Looks fixed now.