Skip to content

Comments

solution to the Dominator exercise#21

Open
fogha wants to merge 11 commits intojsacademyio:masterfrom
fogha:dominator
Open

solution to the Dominator exercise#21
fogha wants to merge 11 commits intojsacademyio:masterfrom
fogha:dominator

Conversation

@fogha
Copy link

@fogha fogha commented May 21, 2020

No description provided.

return 'It doesnt exist'
}

console.log(dominator([3, 4, 2, 3, 3, 2, -1, 3, 3]));
Copy link
Member

Choose a reason for hiding this comment

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

@fogha your function doesn't return the required values.

The question clearly states: returns the index of any element of array A in which the dominator of A occurs. The function should return −1 if array A does not have a dominator.

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