Skip to content

Conversation

@jcalvarezj
Copy link

Completed the findNodesWithZeroAndOneParents function

Copy link
Collaborator

@hyfi06 hyfi06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments

* @returns {number[][]}
*/
const findNodesWithZeroAndOneParents = (parentChildPairs) => {
const result = [[],[]];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creo que pues omitir esta variable si regresas directamente return [ zeroParentsChildren, oneParentChildren];

Comment on lines +22 to +27
let zeroParentsChildren = Array.from(
new Set(
parentChildPairs.map(pair => pair[0])
.filter(child => !(child in countOfParentsPerChild))
)
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants