Retired

String Calculator (retired)

Description
Loading description...
Strings
Fundamentals
  • Please sign in or sign up to leave a comment.
  • hobovsky Avatar

    This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/143.
    Please join the discussion to help us identify duplicate kata and retire them.

  • Malik Hassan Qayyum Avatar

    This comment has been hidden.

  • Malik Hassan Qayyum Avatar

    This comment has been hidden.

  • MrFox27 Avatar

    It would be good to build the test cases up in terms of complexity i.e. input of "", then input of "1", then input of "1, 2" to let the users build up the algorithm in "true" TDD style.

  • Jotha Avatar

    You could also include negative numbers in your test cases, because you even mention that there could be any number.

    The string passed into your function will only contain numbers in string format and can contain any number of comma seperated integers.
  • MaksimSimkin Avatar

    No predefined Class Kata, just the method, so is the code not compilebar

    • james.brett Avatar

      Could you explain further please? Thanks

    • sibicht Avatar

      I think he means the same issue I was having below that you marked as resolved, but it is not. The default "Your solution" you start with is like this:

      public static int AddStrings(string numbers) { // Hack the planet! }

      You can not compile it (Run Tests / Submit), as it is not part of a class, you have to manually add it like this: public static class StringCalculator { public static int AddStrings(string numbers) { // Hack the planet! return 0; //just return something so that it will compile } }

    • james.brett Avatar

      I see exactly what you're saying; that's an awful oversight on my part.

      Thanks a lot for explaining. I've updated the default, would you mind checking?

      Thanks again.

    • MaksimSimkin Avatar

      it's good now, thank you!

      Issue marked resolved by MaksimSimkin 10 years ago
  • sibicht Avatar

    Missing wrapper class in default solution: public static class StringCalculator

    Unless it was on purpose to increase difficulty?