You are given a 0-indexed string s and a 0-indexed integer array distance of length 26.
Letters in s appear exactly twice. For each letter, distance[letter-'a'] specifies the required number of characters between its two occurrences.
Input format: s|d0,d1,...,d25 where the d values are the distance array.
Return 'true' if all distances match, 'false' otherwise.
Input: String s, then '|', then 26 comma-separated distance values.
Output: Return 'true' if all letter distances match, otherwise 'false'.
Input: abaccb|1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Output: true
Explanation: 'a': indices 0,2 → gap=1 ✓; 'b': indices 1,5 → gap=3 ✓; 'c': indices 3,4 → gap=0 ✓.Input: aa|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Output: true
Explanation: 'a' appears at 0,1: gap=0 matches distance[0]=0.Input: aba|1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Output: true
Explanation: 'a' at 0,2: gap=1 matches distance[0]=1.2 <= s.length <= 52s consists of lowercase lettersEach letter in s appears exactly twicedistance.length == 260 <= distance[i] <= 25