# Task
 You are given a `moment` in time and space. What you must do is break it down into time and space, to determine if that moment is from the past, present or future.

 `Time` is the sum of characters that increase time (i.e. numbers in range ['1'..'9'].
 
 `Space` in the number of characters which do not increase time (i.e. all characters but those that increase time).
 
 The moment of time is determined as follows:
```
If time is greater than space, than the moment is from the future.
If time is less than space, then the moment is from the past.
Otherwise, it is the present moment.```

 You should return an array of three elements, two of which are false, and one is true. The true value should be at the `1st, 2nd or 3rd` place for `past, present and future` respectively.

# Examples

 For `moment = "01:00 pm"`, the output should be `[true, false, false]`.
 
 time equals 1, and space equals 7, so the moment is from the past.

 For `moment = "12:02 pm"`, the output should be `[false, true, false]`.
 
 time equals 5, and space equals 5, which means that it's a present moment.

 For `moment = "12:30 pm"`, the output should be `[false, false, true]`.
 
 time equals 6, space equals 5, so the moment is from the future.

# Input/Output


 - `[input]` string `moment`

  The moment of time and space that the input time came from.


 - `[output]` a boolean array

  Array of three elements, two of which are false, and one is true. The true value should be at the 1st, 2nd or 3rd place for past, present and future respectively.

Difficulty: introductory

Starter code:

def moment_of_time_in_space(moment):
	

Solutions:
def moment_of_time_in_space(moment):
    d = sum(int(c) if c in '123456789' else -1 for c in moment)
    return [d < 0, d == 0, d > 0]

def moment_of_time_in_space(moment):
    time = sum(int(c) for c in moment if c in "123456789")
    space = sum(c not in "123456789" for c in moment)
    return [time < space, time == space, time > space]

def moment_of_time_in_space(moment):
    time = 0
    space = 0
    for ch in moment:
        if ch == '0' or not ch.isdigit():
            space += 1
        elif ch in '123456789':
            time += int(ch)
    return [time < space, time == space, time > space]

def moment_of_time_in_space(moment):
    t = sum(int(d) for d in moment if d.isdigit() and d!='0')
    s = sum(c=='0' or not c.isdigit() for c in moment)
    
    return [t<s, t==s, t>s]

from re import findall
def moment_of_time_in_space(moment):
    time=sum(map(int,findall("\d",moment)))
    space=len(findall("[^1-9]",moment))
    states=[False for _ in range(3)]
    if time>space:states[2]=True
    elif time<space:states[0]=True
    else:states[1]=True
    return states

def moment_of_time_in_space(s):
    a = [int(x) for x in s if "1" <= x <= "9"]
    n, m = sum(a), len(s) - len(a)
    return [n < m, n == m, n > m]

def moment_of_time_in_space(moment):
    time = int(moment[0]) + int(moment[1]) + int(moment[3]) + int(moment[4])
    space = 4 + moment.count("0")
    return [time < space, time == space, time > space]

def moment_of_time_in_space(moment):
    a = sum(int(i) for i in moment if i in '123456789')
    b = sum(1 for i in moment if i not in '123456789')
    return [a<b, a==b, a>b]

def moment_of_time_in_space(moment):
    t,s=0,0
    for c in moment:
        if c.isdigit() and c!='0':
            t+=int(c)
        else:
            s+=1
    if t<s:
        return [True,False,False]
    elif t>s:
        return [False,False,True]
    else:
        return [False,True,False]

def moment_of_time_in_space(moment):
  l = [int(i) for i in moment if i.isdigit() and i != '0']
  time = sum(l)
  space = 8 - len(l)
  return [True, False, False] if space > time else\
 ([False, True, False] if space==time else [ False,  False, True])