# Task
`EvilCode` is a game similar to `Codewars`. You have to solve programming tasks as quickly as possible. However, unlike `Codewars`, `EvilCode` awards you with a medal, depending on the time you took to solve the task.

To get a medal, your time must be (strictly) inferior to the time corresponding to the medal. You can be awarded `"Gold", "Silver" or "Bronze"` medal, or `"None"` medal at all. Only one medal (the best achieved) is awarded.

You are given the time achieved for the task and the time corresponding to each medal. Your task is to return the awarded medal.

Each time is given in the format `HH:MM:SS`.


# Input/Output

`[input]` string `userTime`

The time the user achieved.

`[input]` string `gold`

The time corresponding to the gold medal.

`[input]` string `silver`

The time corresponding to the silver medal.

`[input]` string `bronze`

The time corresponding to the bronze medal.

It is guaranteed that `gold < silver < bronze`.

`[output]` a string

The medal awarded, one of for options: `"Gold", "Silver", "Bronze" or "None"`.

# Example

For 
```
userTime = "00:30:00", gold = "00:15:00",
silver = "00:45:00" and bronze = "01:15:00"```

the output should be `"Silver"`

For 
```
userTime = "01:15:00", gold = "00:15:00",
silver = "00:45:00" and bronze = "01:15:00"```

the output should be `"None"`

# For Haskell version
```
In Haskell, the result is a Maybe, returning Just String indicating 
the medal if they won or Nothing if they don't.
```

Difficulty: introductory

Starter code:

def evil_code_medal(user_time, gold, silver, bronze):
	

Solutions:
def evil_code_medal(user_time, gold, silver, bronze):
    for medal, time in [["Gold", gold], ["Silver", silver], ["Bronze", bronze]]:
        if user_time < time:
            return medal
            
    return "None"


from bisect import bisect_right as bisect

MEDALS = ["Gold", "Silver", "Bronze", "None"]

def evil_code_medal(user_time, *times):
    return MEDALS[bisect(times, user_time)]

def evil_code_medal(t,g,s,b):
    return "Gold"if t<g else"Silver"if t<s else"Bronze"if t<b else'None'

def evil_code_medal(user_time, gold, silver, bronze):
    user_seconds = time_to_seconds(user_time)
    if user_seconds < time_to_seconds(gold):
        return "Gold"
    elif user_seconds < time_to_seconds(silver):
        return "Silver"
    elif user_seconds < time_to_seconds(bronze):
        return "Bronze"
    else:
        return "None"
        
def time_to_seconds(time):
    hours, minutes, seconds = time.split(':')
    return 3600 * int(hours) + 60 * int(minutes) + int(seconds)        

def evil_code_medal(user_time, *medals):
    return next(
        (name for name, time in zip("Gold Silver Bronze".split(), medals) if user_time < time),
        "None")

evil_code_medal=lambda *args: ["None","Bronze","Silver","Gold"][sum(arg>args[0] for arg in args[1:])]

def evil_code_medal(user_time, gold, silver, bronze):
    return ['None', 'Bronze', 'Silver', 'Gold'][
        (user_time < bronze) + (user_time < silver) + (user_time < gold)
    ]

evil_code_medal=lambda t,*m:next((s for s,n in zip(("Gold","Silver","Bronze"),m)if t<n),"None")

def evil_code_medal(t, g, s, b):
    return t<g and 'Gold' or t<s and 'Silver' or t<b and 'Bronze' or 'None'

def evil_code_medal(*t):
    return ('None', 'Bronze', 'Silver', 'Gold')[sorted(t, reverse=True).index(t[0])]