From 9db94e8337e17bf27488e1396b7f1b81ab06aeb0 Mon Sep 17 00:00:00 2001 From: morrosusso Date: Tue, 10 Nov 2026 08:57:46 +0000 Subject: [PATCH] docs: add plain-English explanation to practice10 Added explanation comments for the first_letter_twice function. --- solutions/python/practice10.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/solutions/python/practice10.py b/solutions/python/practice10.py index 3855698..b4a111f 100644 --- a/solutions/python/practice10.py +++ b/solutions/python/practice10.py @@ -11,6 +11,12 @@ # - Input: "abccbaacz" → Output: "c" (first appears at index 2, then again at index 3) # - Input: "abcdd" → Output: "d" (first appears at index 3, then again at index 4) # +# Explanation (plain English): +# We read the string one letter at a time and keep a "seen" box of letters. +# For each letter, we check the box. If the letter is already there, it is +# the first one to repeat, so we return it. If not, we put it in the box. +# If we reach the end with no repeat, we return None. +# # Status: ✅ SOLVED def first_letter_twice(s):