it's not the fanciest code but this is my solution #3
Open
arepaFlipper wants to merge 3 commits intoPlatziMaster:masterfrom
Open
it's not the fanciest code but this is my solution #3arepaFlipper wants to merge 3 commits intoPlatziMaster:masterfrom
arepaFlipper wants to merge 3 commits intoPlatziMaster:masterfrom
Conversation
hyfi06
reviewed
May 9, 2020
| # challenge-javascript-11 - Zero and one parents problem | ||
|
|
||
| Suppose we have some input data describing a graph of relationships between parents and children over multiple generations. The data is formatted as a list of (parent, child) pairs, where each individual is assigned a unique integer identifier. | ||
| Suppose we have some input data describing a graph of relationships between parents and children over multiple generations. The data is formatted as a list of [parent, child] pairs, where each individual is assigned a unique integer identifier. |
Collaborator
There was a problem hiding this comment.
es un par ordenado (parent, child). la forma de pasarlo al JS se modela con arrays.
| return a-b; | ||
| }); | ||
| const number = [parents, oneParent]; | ||
| console.log(number); |
Collaborator
There was a problem hiding this comment.
Esto para debug está bien pero trata de limpiar tu código antes de enviarlo.
| const parents = [...new Set(parentChildPairs.map(innerPair => innerPair[0]))]; | ||
| const children = parentChildPairs.map(innerPair => innerPair[1]) | ||
|
|
||
| children.map(j => { |
Collaborator
There was a problem hiding this comment.
No estás regresando nada, usa mejor forEach. Usa nombres de variable más descriptivas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.