The Perfect Lineup

Instructions

In the initial commit to this project, you have been provided with files that contain a JavaScript module and some associated tests. Currently the getPositionCounts and calculateTotalSalary functions are not implemented causing some tests to fail. Use what we have learned about reducing to write a solution to the problem of calculating the total salary of a lineup.

Provided Files

.eslintrc.js - a config file for eslint

.gitignore - this file sets the project up to ignore the node_modules folder when committing to git

package.json - this file sets up the Node project including all the dev dependencies

lineup.js - this file contains the functions for validating a fantasy baseball lineup

tests.js - this file contains tests for the functions in the lineup module

Lineup Rules

  1. The total salary of all players in a lineup may not exceed $45,000
  2. Lineups may not contain more than 2 players from a single team
  3. Lineups may not contain more than 3 players from a single game
  4. Lineups must contain exactly 3 players with the position of 'OF' and must also contain exactly 1 player from each of the following positions: 'P', 'C', '1B', '2B', '3B', 'SS'

Exercise Submission

You should fork this repository and submit your working changes in a pull request to your forked repo.