Ad
  • Custom User Avatar

    In the description, the sentence "The initial string will contain at least two words, otherwise an empty string will be returned" is a bit confusing.
    "The initial string will contain at least two words" sounds like you make a statement about the types of string (testcases) that will be input in the function, so that you do not have to check for exceptions. This is somewhat clarified with the "otherwise" part, but an overall better phrasing might be:
    "If the initial string does not contain at least two words, an empty string will/should be returned".
    This special case also does not fit the other results this function returns. When balancing a string that has only one word, should you not just return that word itself instead of an empty string? Or the word follwed by a second, empty line? Might depend on the use case for this function, but at least that way, you would always return every word of the original string without deleting anything. If you did it this way, you could perhaps even omit the whole point, as it would be included in the last one:
    "In case of conflict or doubt, the first line will be the longest."

  • Custom User Avatar

    Can someone please remove the troll solution from user MRGRD56 ? It might be correct, but just breaks display functionialty of the web site.

  • Custom User 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
    }
    }

  • Custom User Avatar

    Missing wrapper class in default solution:
    public static class StringCalculator

    Unless it was on purpose to increase difficulty?

  • Custom User Avatar

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

  • Custom User Avatar

    Having programmed with .NET 2.0 most of the time, I never much got into contact with Linq until now - this solution just was the first that came to mind.
    Looking at other solutions on this site I have learned so much more about Linq this week than I would ever have imagined before.

  • Custom User Avatar

    Yes, I have noticed and already changed status from "Minor Issues" to "Ready". If there is any other place I should have marked the issue as resolved, then I apologize - I just started here and am still getting used to this site's UI.

  • Custom User Avatar

    Technically working and OK, but

    • PLEASE (have someone) check the grammar/spelling

    • Johnny is NOT clever - best put in a disclaimer / warning to discourage people from actually using passwords built this way from the mail addresses. "Clever" might be meant sarcastic, but not all people are "clever" enough to understand this :)

  • Custom User Avatar

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

  • Custom User Avatar

    Description is a bit unclear what to expect as input, took trial and error to figure it out.

  • Custom User Avatar

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

  • Custom User Avatar

    There already is an almost exactly identical kata to check for leap years.

  • Custom User Avatar

    namespace System was not included by default