Ad
  • Default User Avatar

    The behaviour was defined this way in the original post, you may want to go check it out.

  • Default User Avatar

    the strings might end up being attatched so add a space everytime you add to the string

  • Default User Avatar

    Oh cool, I didn't know about that constructructor for StringBuilder. Thanks!

  • Default User Avatar

    Oh alright, interesting. Thank you!

  • Custom User Avatar

    you've been taught right. But for simple loops, the compiler can effectively optimize them and replace the += stuff with the equivalent of a StringBuilder, giving you the same performances. Tho, don't use that with more complex loops, because then you're mostly "relying on luck" about the choices the compiler does.

  • Default User Avatar

    Did += get faster? I remember being taught that += is really slow because it has to rebuild the strings, but I could be misremembering

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    What the hell is wrong with you? This is literally my previous fork :\

  • Custom User Avatar

    The discourse section on the original kumite creator (@burlacu.valeri) has the creator replying to someone that the expected behaviour for empty strings should be "TRUE". I think i might have misinterpreted that and gave "TRUE" if even one of them is empty. I'll change my code. Thanks for catching that!

  • Custom User Avatar

    Expected behaviour for empty strings is "true"

    Who said that? The original kumite clearly says "verify if the sum of the letters of the name #1 equals the sum of the letters of the name #2".

  • Custom User Avatar

    Nice solution.

    There's a built-in function for checking the case, so you can do:

    s = y[match.group(1).isupper()]

    Instead of

    s = y[is_upper(match.group(1))]

    etc

    Then you don't need the first lambda.

  • Custom User Avatar

    What if... the case changes in the middle of the word? 🤔

    Forked my solution and added that ;)

  • Custom User Avatar
  • Default User Avatar

    Compared to English, probably so. Compared to other languages, the difference from English isn't that big. I'm not sure how "no accent marks" can be easier, it's actually easier when you always know which syllable is stressed.
    I don't really speak Spanish or German, but I'm kind of interested in languages and linguistics in general (not too seriously, more like for fun), so I know some general info about them and partially understand simple sentences y, pues, a veces puedo escribir algo sin traductor. German looks worse than Spanish indeed (on average; of course there always are easier parts in any language); although when it comes to vocabulary, English is a Germanic language, so there are still more similarities than with a random Indo-European language, let alone non-Indo-European.
    Another thing is how logical things are: I think declension just takes time to get used to (mostly), even if it's a lot of time; noun genders are worse (when they can't be deduced from endings), but they only need remembering and it's not a big deal if you mess up. Verb prefixes are what looks scarier to me in the long term. Although maybe it's just my impression; I've read that verb prefixes are one of the hardest things in Russian as a foreign language and I've seen a German example with "umfahren", but I'm not entirely sure how common these weird cases are compared to more easily understandable meanings...

  • Loading more items...