Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Added random tests so invalid solutions won't pass now (updated to Node 12. as well)

  • Custom User Avatar
  • Custom User Avatar

    So it's the same issue as reported below, 3 weeks ago.

  • Custom User Avatar

    and the language is?

  • Custom User Avatar

    @RyanGPalmer. Yep. You got it - it was example of:

    Sometimes a line may be valid in one direction but not the other. Such a line is still considered valid.

    See other discourse comments here. I think other people struggled with exactly same example.

  • Custom User Avatar

    @dinglemouse I understand what you are saying but some of the examples seem to contradict this. For example:

       +-------+
       |      +++---+
    X--+      +-+   X
    

    How does this not count as ambiguous? There is a very obvious junction where you could turn either left or right. However, if you turn left, you get to a dead end. So if it's only considered "ambiguous" when both paths could possibly reach the end, then that contradicts this example:

        +-+    
        | |    
        ++++   
        ++++   
       X+++    
         +---X
    

    There is no junction here where both of the two directions are valid. Thus I'm afraid I just do not understand what meets your definition of ambiguity. (By the way my code passes every test except the latter example, so perhaps its possible we can discuss that, since I have been staring for awhile and do not understand how it could be considered ambiguous. There's only one possible path backwards or forwards.)

    EDIT:

    Nevermind, I understand now. The first example is certainly ambiguous from one direction, but from the other direction there is no ambiguity. Thus it fits your description where paths could potentially be valid from one direction and not the other.

  • Custom User Avatar

    Reading is taught before dividing numbers - more time to forget .. :yum:

    I agreed with you on the ranking until I started simplifying my solution, still in the design stage. If your solution is a 4 kyu, it's overly complicated. The kata is about a 6 and the solution can be a 7.

  • Custom User Avatar

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

  • Default User Avatar

    Dividing numbers is taught at primary school. The only harder thing is detecting the case when there's no "cycle" but it's written in the description.
    OK, maybe not at primary school when it comes to decimal fractions, but still at school.

  • Default User Avatar

    Why? 7 kyu is:

    Iterating arrays and returning a subset of values

    It's almost that with a simple division added, 6 kyu looks right.

  • Custom User Avatar

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

  • Custom User Avatar

    RTFM

    Imagine yourself walking a path where you can only see your very next step. Can you know which step you must take, or not?

    In all your above examples you get to some junction where you cannot know for sure whether to turn left or right.

    That fails my definition of "valid"

    It must be possible to follow the line with no ambiguity (lookahead of just one step).

  • Custom User Avatar

    Just my own preference. Do you have a better suggestion? :)

  • Custom User Avatar

    I see all the previous solutions popping up again, so this should be resolved ;-)

  • Loading more items...