Ad
  • Custom User Avatar
  • Custom User Avatar

    The problem statement should either state that the integers are non-negative, or include tests for negative numbers. Handling negative numbers makes this kata little more interesting, so I would add a test case for negative numbers.

  • Custom User Avatar

    I heard that a higher kyu could mean that this challenge uses "Obscure" features of a language. But I would not exactly call regex an "Obscure" feature since it is used a alot for string validation, but its a guess.

  • Custom User Avatar

    I was able to get a passing solution, but discovered that it would fail for my own test case of 12000000. So I altered my solution to account for that and numbers above. So another agreement on a more robust collection of test cases.

  • Custom User Avatar

    I agree that ideally they should all be written in all languages available. Maybe we can implement a feature to allow sharing so other people familiar with other languages can add them to the original Kata, whichever language that happened to have been when it was created.

    So far the kata I've authored, have all been ruby, simply because I'm not yet comfortable with jasmine testing, and that I am still learning an incredible amount by making kata.

  • Custom User Avatar

    this did not work
    validParentheses(')');

  • Custom User Avatar

    The platform will introduce more languages in the future. Who would be able to create a kata for all supported languages in the future???
    I agree, it would be interesting to see how a problem is solved in another language. But this can be a very complex task, if the API of one language does not support features that are built-in in another. Imagine a simple map/reduce inliner in Javascript. How it looks in Java using only standard library??? (I am no Java expert, maybe there exists a native counterpart...)

  • Custom User Avatar

    Okay it's fixed.

  • Custom User Avatar

    I was also going to propose this. Test cases over a million and with length multiples of three.

  • Custom User Avatar

    Pretty easy for me. Not too familiar with ruby, but def know my y'kno

  • Custom User Avatar

    Though I agree to some extent this will severely limit the numbers of submitted katas! I for one, cannot write in ruby and will likely not be able to deliver a working Ruby solution on most of the katas I write.

    Coffeescript - in my personal view - shouldn't be a languague as it's "simply" a preprocessor. You can wrait it all in javascript and wrap it in "escape-to-javascript"-coffeescript.

  • Custom User Avatar

    I modified the kata such that it now generates a random name for each student (also making sure that the names are still unique). Thanks to the both of you for the advice.

  • Custom User Avatar

    Another agreement!

  • Custom User Avatar
  • Custom User Avatar

    I agree with JulianNicholls. it's straightforward to print the names and the total amount of money that each students has. once you have that, passing with the solution above is easy.

    Random tests are not against the spirit of Code Wars. In fact, it is even part of the Test framework:

    Test.random_number() → Integer
    

    Returns a random number. Useful for testing dynamic values that can't easily be hard coded into solutions

    Test.random_token() → String
    

    Returns a random string. Useful for testing dynamic values that can't easily be hard coded into solutions

  • Loading more items...