Ad
  • Custom User Avatar

    The idea to use RegEx for this is broke my mind. If someone know how it possible, please tell me (seriously :)

    There is three things that need your attention in this Kata. 1) You get a string 2) If you split this string, you also get strings but in array 3) JavaScript is a loosely typed and dynamic language but it has methods for pointing type of data (it is helpful with compare).
    You can find tones of good information about JS in MDN Web Docs

  • Custom User Avatar

    Since all the number are separated by a single space, it should be easy to convert the string into an array/list, or you can just go through it char by char and make the array/list manually.

    I don't use JavaScript very often (and if I do I always wash my hands afterwards), so I don't know the exact options you have available or what other things you will have to do to the list afterwards. The easiest is likely just to google something like "JavaScript convert string to array" or something.

    I also don't want to spoile too much. Learning to google for answers and ideas is important nowadays.

  • Default User Avatar

    I agree. That's how you learn best and fastest. Carrying out the (more or less) same task over and over until you can do it without thinking. They call it muscle memory, if I'm not mistaken.
    There are plenty of those, though. Check out the filters to the left of your screen and actively search for Kata's that are marked 'Easiest' or 'Most completed', and start with those. You will quickly get the hang of it.

  • Custom User Avatar

    As far as I know, no one has ever used RegEx in this kata challenge. I don't really see why anyone would.

    Any specific reason you ask?
    Which programming language are you using?

  • Custom User Avatar

    Casting a string to a number.