← Questions

Shortest distance between X and Y in a string

0
GleanCoding

Find the shortest distance between characters X and Y in a string in one pass. Reported on 1point3acres' Glean bank; reconstructed in our own words.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding