Ad
  • Default User Avatar

    no answer from OP and no evidence given

  • Custom User Avatar

    Ignoring the $z$ coordinate can give that impression, yeah. You're wrong, author's right. Closing.

  • Custom User Avatar

    Approved

  • Default User Avatar

    Friendship is commutative. (The description doesn't explicitly say this, but I think it's clear from the example given, which has Harry/Ron but not Ron/Harry.)

    Can you post the test case (the first few lines of it, at least) that produced the strange behaviour?

  • Custom User Avatar

    I can't pass the first test case. I had a solution that did return a clique (allowing for if X knows Y, then also Y knows X). The test said there shouldn't be any cliques. So then I coded up a non-commutative alogrithm, and then for the same problem the test harness says there should be at least one (!).

  • Custom User Avatar

    A prematurely approved purple kata creates an unfortunate situation. Any chance you can work on the remaining issues, and also the open suggestions below?

  • Custom User Avatar

    @eurydice5717 if you know how to improve them without changing the essence of the task too much, I’m totally fine with that. Honestly, I agree that this kata turned out to have way too many issues. I kept trying to figure out how to solve them, but after 3 years, the best I could do was just close my eyes and pretend it didn’t exist. Then I just stopped liking the whole idea of the kata because I thought I had created something interesting, but it ended up being pretty mediocre. So, I came to terms with the fact that it couldn’t be fixed and wouldn’t pass review. That’s why I was surprised when I saw an email a couple of days ago saying someone had approved it (thank you for that btw)

  • Custom User Avatar

    Edit: Comment removed

  • Custom User Avatar
  • Custom User Avatar

    Damn, that's really cool and well thought out!
    Especially the return statement. I thought I needed to play let it play out with the first attacker, but that makes much more sense.

  • Custom User Avatar

    for anyone solving this currently and confused by this edgecase: The solver appears to expect the output array to grow by at least 2 on each iteration, so if your result is an empty array after trimming leading and trailing zeroes you can create a new array of list.length + 2 and fill it with zeroes.

  • Default User Avatar

    Thanks @geoffp - after attempting to read and reread this kata and going slightly mad thinking I couldn't understand it, you've explained it in such a nicer way.

  • Default User Avatar

    That's true, but there is no better way to do it, short of resorting to a higher-precision floating-point type.

  • Custom User Avatar

    You forgot for double inprecision, basicly floating-point arithmetic, not a good idea.

  • Default User Avatar
  • Loading more items...