In this Kata, you will be given a string and your task is to return the most valuable character. The value of a character is the difference between the index of its last occurrence and the index of its first occurrence. Return the character that has the highest value. If there is a tie, return the alphabetically lowest character. `[For Golang return rune]`

All inputs will be lower case. 

```
For example:
solve('a') = 'a'
solve('ab') = 'a'. Last occurrence is equal to first occurrence of each character. Return lexicographically lowest.
solve("axyzxyz") = 'x'
```

More examples in test cases. Good luck!

Difficulty: introductory

Starter code:

def solve(st):
	

Solutions:
def solve(st):
    return sorted((st.find(c) - st.rfind(c), c) for c in set(st))[0][1]

def solve(st):
    return min(set(st), key=lambda c: (st.index(c)-st.rindex(c), c))

def solve(s):
    d = {}
    for i,c in enumerate(s):
        if c not in d: d[c] = [i,i]
        else:          d[c][-1] = i
    return min(d, key=lambda k: (d[k][0]-d[k][1], k))

def solve(st):
    highestVal = 0
    mvc = None
    for c in st:
        firstIdx = st.index(c)
        lastIdx = st.rindex(c)                 
        value = lastIdx - firstIdx
        if not mvc or value > highestVal:
            highestVal = value
            mvc = c
        elif value == highestVal:
            if c < mvc: 
                highestVal = value
                mvc = c
    return mvc            


def solve(st):
#Create a dictionary. Add every new char to dictionary. Check if that char is elsewhere in the
# string. if it is, assign the value to the distance from each other. 
# If that char has the greatest distance, return that char. 
# If equal with others, return .isalpha

    # first_seen = {"a": 0, "b":2, "c":3}
    first_seen = {}
    distance = {}
    #distance = {"a": 1,"b":2, "c": 2, d:2} 

    for index, char in enumerate(st):
        if char not in first_seen:
            first_seen[char] = index
            
        distance[char] = index - first_seen[char] 
        
    # max = 2
    max = distance[st[0]] 
    # max = b
    max_char = st[0]
    
    for key in distance:
        if distance[key] > max:
            max = distance[key]
            max_char = key 
        elif distance[key] == max:
            if key < max_char:
                max_char = key
                
    return max_char

def solve(st):
    dict = {'z': 0}
    for letter in set(st) : 
        this = [a for a in range(len(st)) if st[a] == letter]
        that = max(this) - min(this)
        if that > max(dict.values()) : dict = {letter : that}
        elif that == max(dict.values()) : dict[letter] = that
    return sorted(dict.keys(),reverse=False)[0]

def solve(s):
    vals = {}
    for i, c in enumerate(s):
        if c not in vals:
            vals[c] = [i, i]
        else:
            vals[c][-1] = i
    return min(vals, key=lambda k: (vals[k][0] - vals[k][1], k))

def solve(st):
    d = dict((st.rfind(c)-st.find(c),c) for c in sorted(st)[::-1])
    return d[max(d)]

def solve(st):
    left_index = dict()
    right_index = dict()
    
    for i, c in enumerate(st):
        right_index[c] = i
    for i, c in reversed(list(enumerate(st))):
        left_index[c] = i
        
    return max((right_index[c] - left_index[c], -ord(c), c) for c in set(st))[2]

solve=lambda s:sorted(s,key=lambda e:s.rindex(e)-s.index(e)-ord(e)/1000)[-1]