Shortest Distance to a Character
For each position in a string, find the distance to the nearest occurrence of a given character. The visual sweeps left to right and right to left to carry the closest distance along.
For each position in a string, find the distance to the nearest occurrence of a given character. The visual sweeps left to right and right to left to carry the closest distance along.