As reported: Capital One CodeSignal online assessment (70 minutes), Feb 2026: four questions — counting triplets in a string (three letters where the first and third are equal, e.g.
"axA"is one triplet), a power-booster distance problem, applyingswapRows/swapCols/rotate90commands to a matrix, and printing a path in a directed acyclic graph.
A triplet is a substring of length 3 whose first and third letters are the same letter, ignoring case ("axA" is a triplet). Given s, return the number of triplets — overlapping ones count separately.
Example
"axA" -> 1
"abAxxX" -> 2 ("abA" and "xxX")
"aaaa" -> 2
Constraints: 0 ≤ s.length ≤ 10^5; s holds English letters.
Code runner format: one line with s as a JSON string. Implement countTriplets(s); the harness prints the count.