diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 20408047..b5b0dfcd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +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 + # Changes to `fetch-configlet` should be made in the `exercism/configlet` repo bin/fetch-configlet @exercism/maintainers-admin diff --git a/docs/SIGN_UP_SNIPPET.txt b/docs/SIGN_UP_SNIPPET.txt new file mode 100644 index 00000000..3f5c3039 --- /dev/null +++ b/docs/SIGN_UP_SNIPPET.txt @@ -0,0 +1,11 @@ +function! MostCommonWord(text) abort + let counts = {} + let best = '' + for word in split(tolower(a:text), ' ') + let counts[word] = get(counts, word, 0) + 1 + if counts[word] > get(counts, best, 0) + let best = word + endif + endfor + return printf('"%s" appears %d times', best, counts[best]) +endfunction