Ad
  • Custom User Avatar

    Great kata to learn to understand language features in JS.

  • Custom User Avatar

    I have never had so much fun when solving a kata as this.ㅤ♡

  • Custom User Avatar

    I got this question in my Meesho New Grad interview. Lmao, I’m the luckiest person alive. The interviewer was so happy with my solution. He was expecting a C++ answer at first, but I coded it in both C++ and Python (one of their required skills was Python). You should’ve seen his face, lmao.

    I just can’t stop laughing — just one day before I was cussing this question, and the next day I’m grateful. HAHAHAHA

  • Custom User Avatar

    Gaps between words can't differ by more than one space.
    (This statement feels a bit contradictory.)

    The difference between any two gaps should not be more than 1
    (Using this phrasing removes the ambiguity and confusion.)

  • Custom User Avatar
  • Custom User Avatar

    Nevermind, it looks like there was a fork that fixed this.

  • Custom User Avatar

    Can you provide an example of a passing solution that returns a static string? I can't seem to find any.

  • Custom User Avatar

    Hopefully fixed in this fork

    Expected output is horrendously underspecified however, so there may be other bugs.

  • Custom User Avatar

    Approved.

  • Custom User Avatar

    No, there is an actual full-stop after orci, so the sequence of spaces is 2-2-1-1, which does not leave enough room for at and another space.

  • Custom User Avatar

    Below you can see an excerpt from the description/sample tests in python, I replaced space characters by dots to make it easier to compare. The expected line length is 30 characters.

    (1)"nunc,..at..aliquet.orci..Fusce"
    (2)"at...dolor...sit...amet..felis"
    

    The sequence of spaces in line (1) is: 2, 2, 2.
    The word "at" at the beginning of line (2) could be appended at the end of line (1) if each sequence of 2 spaces would be replace by 1 space, couldn't it?

  • Custom User Avatar

    The order of expecetd and actual has been corrected wuth the above fork, but remaining points still stand.

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    This one was fun.. but it is borked.

    Starting from description (it is confusing) - and ending with tests:

    1. It expects to not allow passing undefined values as arguments. I took that into account of course and added a throw... And the check in my code was done on every function call (as I believe it is reasonable that the deps objects may change on runtime). And.. it failed one of the tests. The correct approach was to not bother at all.

    2. And secondly, it expects that arguments that are not present in the deps objects are... skipped. Completely ruining the order of arguments if some are not present, which makes this pretty useless approach even more useless.

    And, of course, back when this kata was created - no such thing as default parameters existed, so it does not take them into account...

  • Loading more items...