diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0547c0cdcf..6e483fab1f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,9 @@ # Code owners .github/CODEOWNERS @exercism/maintainers-admin + +# The code sample shown in the code check when people sign up to Exercism +docs/SIGN_UP_SNIPPET.txt @exercism/maintainers-admin + .github/workflows @exercism/javascript # Changes to `fetch-configlet` should be made in the `exercism/configlet` repo diff --git a/docs/SIGN_UP_SNIPPET.txt b/docs/SIGN_UP_SNIPPET.txt new file mode 100644 index 0000000000..6e04592fe6 --- /dev/null +++ b/docs/SIGN_UP_SNIPPET.txt @@ -0,0 +1,11 @@ +function mostCommonWord(text) { + const counts = {}; + let best = ""; + for (const word of text.toLowerCase().split(" ")) { + counts[word] = (counts[word] || 0) + 1; + if (counts[word] > (counts[best] || 0)) { + best = word; + } + } + return `"${best}" appears ${counts[best]} times`; +}