Back to problems

Symmetric Triplets

Algorithm · Capital One · Easy

Requirements Input consists of one string, s. Inspect each consecutive three-character window s[i:i+3]; add one to the count whenever s[i].lower() == s[i+2].lower(). Produce the resulting count. If the string contains fewer than three characters, the answer is 0. Examples The first and third characters match after case normalization in each counted window. Notes This is typically the first OA question. Completing it within 3–4 minutes preserves a 65-minute window for the…

Checking your access…