Ad
  • Custom User Avatar

    Finding specific keys in a nested structure is a duplicate to many existing katas.

  • Custom User Avatar

    Still no random tests.

    Your not knowing how to do that is no reason to close that issue.

  • Custom User Avatar
    const categories = {
      category: "vehicles", children: [
        { category: "cars", children: [ { category: "mercedes", children: [] } ] },
        { category: "trucks", children: [ { category: "mercedes", children: [] } ] },
        { category: "motorcycle", children: [ { category: "BMW", children: [] } ] },
      ]
    };
    

    Why use null when an empty array [] would have been more logical and consistent? Or just leave out children entirely where null. If you query for a value anyway, you'll get undefined which is not exactly the same, but as good as null (and also not an array, so just as bad as null :).

    (Speaking of consistency, "motorcycle" should have been plural.)

  • Custom User Avatar

    It's a double. I can't immediately find it, but I've done this before. If someone could find that, please post it.

    That probably means the best you can do is unpublish this and come up with a novel idea. Sorry if I sound harsh, and I'll give you that at least it's not the umpteenth Fibonacci kata, but CodeWars does not need endless identical kata.