Skip to content

Instantly share code, notes, and snippets.

@robwhitaker
Last active August 25, 2017 20:10
Show Gist options
  • Save robwhitaker/a22fd5d2b454812317cae02f50604bdf to your computer and use it in GitHub Desktop.
Save robwhitaker/a22fd5d2b454812317cae02f50604bdf to your computer and use it in GitHub Desktop.
function mindPsAndQs(input) {
return input.match(/[PQ]+/g).reduce(function(acc, str) {
return Math.max(acc, str.length);
}, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment