4 kyu

Elemental Words

375 of 924dcsmith
Description
Loading description...
Strings
Algorithms
Recursion
Arrays
  • Please sign in or sign up to leave a comment.
  • CoreTOP Avatar

    It would be grat to have some of the link with all periodic table of elements.. In the internet in different places could same elements could be named differently (USA/Britain) and also in some places number of elements could be 118, in other 120...

    In this task this tests is hidden and as a blackbox for developer, which list expected, because this is even missed in tests.

    American chemical sosiety know just 118, but this task is not clear what exactly you are expecting here

  • Awesome A.D. Avatar

    Rust translation ready for review.

    Note: updates description.

  • Concker88 Avatar

    Very fun Kata.

  • Mauplex Avatar

    TypeError: Cannot read property 'sort' of undefined at mySort (test.js:28:14) at doTest (test.js:24:25) at tests.forEach.test (test.js:21:23) at Array.forEach () at Context.it (test.js:21:7)

    I haven't even wrote any code yet, why is it giving me an error?
    
  • benjaminzwhite Avatar

    Nickel Cerium Oxygen Neon! Thanks for the cool kata idea, and the implementation/description is great also.

  • MichaelSpicerZA Avatar

    This comment has been hidden.

  • cantriz Avatar

    How i can import dictionary in VS?

  • Persa Avatar

    Nice kata

  • Awesome A.D. Avatar

    C# Translation ready for review.

    After talking with Mauro, it seems the consensus is that the empty string as input should yield an empty array, so that is what I did too.

  • justadude27 Avatar

    This comment has been hidden.

  • ansis m Avatar

    This comment has been hidden.

  • FArekkusu Avatar

    Initial solution in Python should explicitly import ELEMENTS.

  • mauro-1 Avatar

    Python translation:
    https://www.codewars.com/kumite/60c68c6be8f14f003d0bd043?sel=60c68c6be8f14f003d0bd043

    What to do with empty strings (see issue)?

    • return [] (as in javascript)
    • return [[]] (more coherent)
    • don't test empty strings (current choice)
  • mauro-1 Avatar

    (Javascript) From log on stderr:

    assertSimilar is deprecated, use assertDeepEquals

  • Unnamed Avatar

    The tests expect [] for elementalForms(''), but there's nothing about this case in the description and "is not an elemental word" is defined as "no combination of element symbols can form word" without any mention of empty words, so it isn't the case that a word can't be empty.

  • costagavras Avatar

    Hi, I think it's time for me to call for help. My solution passes 147 tests and times out on "floccinaucinihilipilification". I'm pretty sure the problem lies in my recursive approach to get possible combinations of 1-2-3 chars from the given word to match against ELEMENTS. So, the question is whether my recursive approach makes any sense and can be sped up (any ideas how?) or should be abandoned altogether. Thank you

  • G_kuldeep Avatar

    Nice one and refreshing :)

  • mulveyj Avatar

    Hi. I've just completed this kata. I get passes on all the sample tests and then when I hit "ATTEMPT" I get passes on (all?) 353 tests with no errors or failures reported. Runtime is typically 450ms. However, I do not get the "SUBMIT" button coming up. Is there an element of the test that I am missing (eg a performance requirement)? Any ideas why I am not able to submit?

    @dcsmith Instructive exercise, by the way.

  • gabbek Avatar

    It's a shame that such a good katas are in beta for so long. Will try to convince some people to solve this :) Thank you for your hard work!

  • joh_pot Avatar

    Good kata!