Given a string `S` and a character `C`, return an array of integers representing the shortest distance from the current character in `S` to `C`.
### Notes
* All letters will be lowercase.
* If the string is empty, return an empty array.
* If the character is not present, return an empty array.
## Examples
```python
shortest_to_char("lovecodewars", "e") == [3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4]
shortest_to_char("aaaabbbb", "b") == [4, 3, 2, 1, 0, 0, 0, 0]
shortest_to_char("", "b") == []
shortest_to_char("abcde", "") == []
```
___
If you liked it, please rate  :D
def shortest_to_char(s,c):
    i = s.find(c)
    if i==-1 or not c: return []
    
    lst = list(reversed(range(1,i+1)))
    while i != -1:
        j = s.find(c,i+1)
        if j == -1:
            lst.extend(range(len(s)-i))
        else:
            x = j-i>>1
            lst.extend(range(0,x+1))
            lst.extend(reversed(range(1,j-i-x)))
        i = j
    return lst
def shortest_to_char(s,c):
    i = s.find(c)
    if i==-1 or not c: return []
    
    lst = list(reversed(range(1,i+1)))
    while i != -1:
        j = s.find(c,i+1)
        if j == -1:
            lst.extend(range(len(s)-i))
        else:
            x = j-i>>1
            lst.extend(range(0,x+1))
            lst.extend(reversed(range(1,j-i-x)))
        i = j
    return lst