Skip to content

Conversation

@Armando101
Copy link

No description provided.

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

const findNodesWithZeroAndOneParents = (parentChildPairs) => {
// Parents
let parents=[];
parentChildPairs.map((Parents) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Usa mejor usa otro nombre para el atributo del callback del map. Recuerda usar camelcase. Estrictamente no son solo Patrents es una tupla de padre e hijo.

// Childrens
let childrends=[];
let childrendsMoreThanOneParent =[];
parentChildPairs.map((Childrends) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

si tu variable es parentChildPairs usa mejor parentChildPair para referirte a un elemento del array en el map.

Comment on lines +27 to +31
let zeroParents = [];
parents.map((Parents) => {
if (!(childrends.includes(Parents)))
zeroParents.push(Parents);
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mejor usa filter

Comment on lines +33 to +37
let exactlyOneParent = [];
childrends.map((Childrends) => {
if (!(childrendsMoreThanOneParent.includes(Childrends)))
exactlyOneParent.push(Childrends);
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mejor usa filter

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