Created
October 22, 2021 10:46
-
-
Save Cst2989/11075e905fcaf22f95fbfda6228c7b9a to your computer and use it in GitHub Desktop.
finished bowling score
This file contains 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
export const bowlingScore = (inputRolls) => { | |
if (inputRolls.length < 20 || inputRolls.length > 21 || inputRolls.some(roll => roll < 0)) { | |
return 'Invalid rolls input' | |
} | |
const arrayOfRolls = listToMatrix(inputRolls); | |
return totalScore(arrayOfRolls); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment