GoogleSoftware Engineer · Technical ScreenCodemia practiceCount shortest distance in string
Given a string, write a function to count the shortest distance between each character and a specified target character. The function should take two inputs: the string and the target character, and return a list of integers representing the shortest distances for each character in the string to the nearest occurrence of the target character.
Medium
Coding & Algorithms