Skip to content

Commit

Permalink
feat(2023): update solution for challenge #12
Browse files Browse the repository at this point in the history
  • Loading branch information
iswilljr committed Dec 12, 2023
1 parent f85c1c4 commit 6f117b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 2023/challenge-12/challenge-12.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ export function checkIsValidCopy(original: string, copy: string) {
' ',
].includes(copyLetter)

const isBlankSpace = +(letter === ' ')
const isValidCharacter = [isValidLetter, copyLetter === ' '][isBlankSpace]
const isLetterBlankSpace = letter === ' '
const isCopyLetterBlankSpace = copyLetter === ' '

const isValidCharacter = [isValidLetter, isCopyLetterBlankSpace][
+isLetterBlankSpace
]

isValidCopy = [isValidCopy, isValidCharacter][+isValidCopy]
}
Expand Down

0 comments on commit 6f117b6

Please sign in to comment.