Ad
  • Custom User Avatar

    Recursion is slower than if you used a data structure. Forking.

  • Default User Avatar

    @alexandersmanning said it totally right...furthermore in this thing look for your loop condition..you don't need to loop it for n..1 just half n/2..1 is enough for the solution. I hope this will help you out.

  • Custom User Avatar

    The "1A" comes from counting up the first 22 polydivisible numbers in base 16 (the counter of 22 is in base 10 here). That is, if you were to begin counting up from 0 in base 16, 1A would be the 22nd polydivisible number you encounter.

    It's important to understand which base you need to be performing calculations in and at what time. This piece of the description will make your life easier if you carefully consider the implications:

    "The interesting thing about polydivisiblity is that it relates to the underlying number, but not the base it is written in, so if aliens came to Earth and used base 23 (11 fingers on one hand and 12 on the other), no matter what squiggles they used to write numbers, they would find the same numbers polydivisible!"

  • Default User Avatar

    Can you explain how it comes '1A' in the example?

  • Custom User Avatar

    Once the base increases past 10, you no longer have enough digits in [0..9] to represent a single place in a number, so we must extend the set of digits we use to represent the number. By joining [0..9], [A..Z] and [a-z] we have 62 easily representable "digits" that we can use. We could add more but this kata only uses up to 62.

    The code which tests our solutions declares a constant string named CHARS which contains each possible digit we will be expected to use. You can print the string buy including a statement such as "print CHARS" in your solution, but the contents of CHARS doesn't really matter, only the index of the character we use.

  • Custom User Avatar

    Can anyone explain this part to me?

    A Note on Bases
    
    The maximum base used is base 62, and uses characters in the following order [0-9][A-Z][a-z] to denote its digits, 
    base n will used the first n characters of this sequence. A constant CHARS has been declared with this sequence for you.
    
    

    Or have a link that I can read up on?

  • Custom User Avatar

    It's not possible.
    They announced in description, that this has been done on purpose.
    And TCO is now not supported in Babel.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    you have to make primes an object with a property called first which is a function.

    var Primes = {

    first: function{
    TODO
    }

    }

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    In haskell, I am getting an error because my outout is a string? here is the error output

    The Haskell variant expects a Maybe String, not a String. To the original author: a Maybe String can be either Just <some string>, for example Just "Paris", Just "Berlin", or Nothing. E.g.

    citiesVisited = ["Mexico City","Johannesburg","Stockholm","Osaka","Saint Petersburg","London"]
    citiesOffered = ["Stockholm","Paris","Melbourne"]
    
    conferencePicker citiesVisited citiesOffered == Just "Paris"  -- Paris is the first not visited city
    conferencePicker ["Paris"]     ["Paris"]     == Nothing       -- all cities visited
    conferencePicker ["The Moon"]  []            == Nothing       -- no city to visit
    

    The Haskell version therefore differs in the expected type and result slightly from the other variants. However, using Maybe (or another type that indicates error) is usually considered better practice.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Default User Avatar

    Many thanks for this exercise on linked lists :D I've never heard of them before so I have learned a lot from this Kata :D

  • Loading more items...