← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a string s consisting of lowercase and uppercase English letters, count the number of symmetric triplets. A symmetric triplet is a contiguous substring of length 3 (i.e. indices i, i+1, i+2) where the first and third characters are the same letter regardless of case. Formally, for each valid starting index i, check whether tolower(s[i]) == tolower(s[i+2]); if true, that substring is a symmetric triplet. Return the total count of such triplets in the string.