• 0 Posts
  • 19 Comments
Joined 6 months ago
cake
Cake day: June 23rd, 2024

help-circle

  • There is a much nicer way of checking.

    Rust iterators are really powerful. Try using them instead of loops, whenever you can.

    Tap for solution
    let is_palindrome = input.chars().eq(input.chars().rev());
    

    As you can see, the intent is much clearer instead of indexing into the loops. Technically this does however twice as many comparisons. They can be avoided with take and half the size of the iterator.







  • I want to disagree on German. It isn’t verbose. We’ve got several words where there isn’t an equivalent in pretty much any other languages. Including Schadenfreude und Torschlusspanik (the feeling that you are getting older l, can’t find a partner and will die alone).

    The same EU legal text has in German 22.118 words Vs English 24.698.

    The making me cry part, that’s fair. Overcomplicated, could be worse.