Last active
December 25, 2018 23:01
-
-
Save WDever/8322e18895213367731ada512ead20af to your computer and use it in GitHub Desktop.
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
const solution = (s) => { | |
let pEa = 0; | |
let yEa = 0; | |
pEa = (s.match(/p/gi) || []).length; | |
yEa = (s.match(/y/gi) || []).length; | |
console.log(pEa, yEa); | |
if(pEa === yEa) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment