From 417e11b0aceaffd0c05edc3f77c166298b220afb Mon Sep 17 00:00:00 2001 From: Jeremy Walker Date: Sat, 7 Nov 2026 17:31:34 +0900 Subject: [PATCH] Add a sign-up snippet The Exercism sign-up page shows this code sample to people who say they can code a little, to check whether they understand coding basics. The maintainers-admin team owns the file. Co-Authored-By: Claude Opus 5.5 --- .github/CODEOWNERS | 3 +++ docs/SIGN_UP_SNIPPET.txt | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 docs/SIGN_UP_SNIPPET.txt diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2040804..b5b0dfc 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 0000000..9ae2a2f --- /dev/null +++ b/docs/SIGN_UP_SNIPPET.txt @@ -0,0 +1,16 @@ +create or replace function most_common_word(i_text varchar2) return varchar2 is + type word_counts is table of pls_integer index by varchar2(100); + counts word_counts; + word varchar2(100); + best varchar2(100); +begin + for i in 1 .. regexp_count(i_text, '[^ ]+') loop + word := regexp_substr(lower(i_text), '[^ ]+', 1, i); + counts(word) := case when counts.exists(word) then counts(word) + 1 else 1 end; + if best is null or counts(word) > counts(best) then + best := word; + end if; + end loop; + return '"' || best || '" appears ' || counts(best) || ' times'; +end; +/