Count Symmetric Length-3 Substrings

Asked at Capital One · Coding Questions · Difficulty: Easy

Given a string `s`, count the number of contiguous length-3 substrings whose first and last characters match, case-insensitively. The middle character is irrelevant. Strings shorter than 3 return 0.

Loading the problem…