You are given a s consisting of lowercase English letters, where every letter present in s appears exactly twice. You are also given a distance of length
The alphabetical letters are mapped to indices from 'a' corresponds to 'b' corresponds to 'z' which corresponds to
A string s is considered well spaced if, for every letter that appears in s, the number of characters strictly between its two occurrences is equal to distance[i], where i is the s, its corresponding value in distance can be ignored.
Return true if s is a well spaced string, otherwise return false.
Constraints:
s.length
s consists only of lowercase English letters.
Each letter appears in s exactly twice.
distance.length
distance[i]
You are given a s consisting of lowercase English letters, where every letter present in s appears exactly twice. You are also given a distance of length
The alphabetical letters are mapped to indices from 'a' corresponds to 'b' corresponds to 'z' which corresponds to
A string s is considered well spaced if, for every letter that appears in s, the number of characters strictly between its two occurrences is equal to distance[i], where i is the s, its corresponding value in distance can be ignored.
Return true if s is a well spaced string, otherwise return false.
Constraints:
s.length
s consists only of lowercase English letters.
Each letter appears in s exactly twice.
distance.length
distance[i]