Ad
  • Custom User Avatar

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

  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    You can check any code of js function for example getBodyLength.toString()

  • Default User Avatar

    The description could be a little bit clearer, although it does describe what's happening.

    To clarify: In the tests, two clients are being instantiated, called A and B. A sends the A messages, i.e. in your example, A sends "a1" and "a2". B sends the B messages; in your example, B sends "b1".

    The result should be that client A receives the message "b1", and client B receives the messages "a1", "a2", in that order.

    It seems that in your implementation, all messages are being received by client B. Maybe something went wrong with the instantiation?

    Edit: Aaand I answered a 7 months old question. Sorry, should have checked the date before my necromancy.

  • Custom User Avatar

    Little bit confused since my function does recieve it in order. But not in the correct objects for the test?

    Sends: [A1,B1,A2], Recvs [B1,A2,A1]
    Expected: {"a":["b1"],"b":["a1","a2"]}, instead got: {"a":[],"b":["a1","b1","a2"]}
    

    As you can see, the test sends:

    [A1,B1,A2]
    

    And my function (incorrectly?) returns:

    instead got: {"a":[],"b":["a1","b1","a2"]}
    

    Sort of understand why, but any input? How would a recieve function execute correctly before an argument is sent?

  • Custom User Avatar

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

  • Custom User Avatar

    A bit confused on how getBodyLength()? works. Would you mind displaying the code in the instructions, or post it on here?

  • Custom User Avatar

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

  • Custom User Avatar

    Cool, I think I understand now that it's broken up. Is there a formal coding term for this unique navigation (so I can read into it)?

  • Custom User Avatar

    Solution is the path from "field" to "bread". We apply "gather" to "field" to get "wheat", then apply "mill" to "wheat" to get "flour", then apply "bake" to "flour" to get "bread". Process consist of name, source item, target item. Solution must return names of the processes (edges), not items (nodes).

  • Custom User Avatar

    Read the comments, but still can't understand the instructions/problem. Can anyone enlighten me, as if you were explaning this to child XD?

    Confused what the solution means, example

      var test_processes = [
          ['gather', 'field', 'wheat'],
          ['bake', 'flour', 'bread'],
          ['mill', 'wheat', 'flour']
      ];
    
    processes('field', 'bread', test_processes); 
    // should return ['gather', 'mill', 'bake']
    

    Wouldn't the shortest distance between 'field' and 'bread' be 'wheat' or 'flower'? Since those are the nodes from 'field' --to--> 'bread'?

  • Custom User Avatar

    Hey, if you don't mind me asking, how were you able to test/run this? This code works on codewars enviroment, but when I try using babel/webstorm and compiling it to es5, I get errors.

  • Custom User Avatar

    Instructions not very clear. Please provide more detailed input/output examples