-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Answer #1
base: master
Are you sure you want to change the base?
Answer #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice use of additional concepts, methods, etc. Great unique solutions here. Excellent work.
if (inputLineup.length > 9) return false | ||
|
||
|
||
// calculate our total salary, if it's more than %45,000 return false and exit function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple and accurate. Nice work!
// make an array of every result we are looking for | ||
const allResults = array.map(array => array[propertyName]) | ||
// now trim all results and get each unique value | ||
const uniqueResults = [...new Set(allResults)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of Set
|
||
}); | ||
|
||
// now check our array to see if there are more then allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of max
let otherArray = players.filter(player => player != 'OF') | ||
|
||
// now we check if our OF count is correct and our players are all unique positions and there are 6 of them | ||
// if all 3 is true then we have 3 OF and a P, C, 1B, 2B, 3B, and SS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever solution!
No description provided.