In genetics, a sequence’s motif is a nucleotides (or amino-acid) sequence pattern. Sequence motifs have a biological significance. For more information you can take a look [here](https://en.wikipedia.org/wiki/Sequence_motif).


For this kata you need to complete the function `motif_locator`. This function receives 2 arguments - a sequence and a motif. Both arguments are strings.

You should return an array that contains all the start positions of the motif (in order). A sequence may contain 0 or more repetitions of the given motif. Note that the number of the first position is 1, not 0.

**Some examples:**

- For the `sequence` "ACGTGGGGACTAGGGG" and the `motif` "GGGG" the result should be [5, 13]. 
- For the `sequence` "ACCGTACCAAGGGACC" and the `motif` "AAT"  the result should be []
- For the `sequence` "GGG" and the motif "GG" the result should be [1, 2]

**Note**: You can take a look to my others bio-info kata [here](http://www.codewars.com/users/nbeck/authored)

Difficulty: introductory

Starter code:

def motif_locator(sequence, motif):
	

Solutions:
def motif_locator(sequence, motif):
    res, i = [], 0
    while True:
        i = sequence.find(motif, i) + 1
        if not i: return res
        res.append(i)

def motif_locator(sequence, motif):
    return [i+1 for i,c in enumerate(sequence) if sequence[i:i+len(motif)] == motif]

def motif_locator(seq, motif):
    dex = 0
    result = []
    while True:
        dex = seq.find(motif, dex)
        if dex == -1:
            return result
        dex += 1
        result.append(dex)

def motif_locator(s, motif):
    return [i + 1 for i in range(len(s) - len(motif) + 1) if s[i:].startswith(motif)]

from itertools import count

def motif_locator(sequence, motif):
    if len(motif) > len(sequence): return []
    n = len(motif)
    target_hash = sum(map(ord, motif)) 
    hashish = sum(map(ord, sequence[:n]))
    res = []
    for i in count():
        if hashish == target_hash and sequence[i:i+n] == motif:
            res.append(i+1)
        if i + n == len(sequence):
            return res
        hashish += ord(sequence[i+n]) - ord(sequence[i])

import re

def motif_locator(sequence, motif):
    return [m.start() + 1 for m in re.finditer('{}(?={})'.format(motif[0], motif[1:]), sequence)]

def motif_locator(sequence, motif):
    start=0
    arr=[]
    while True :
        index=sequence.find(motif,start)
        if index ==-1:
            break
        start =index+1
        arr.append(index+1)
    return arr

def motif_locator(s, motif):
    return [i+1 for i, c in enumerate(s) if s[i:i + len(motif)] == motif]

motif_locator = lambda s,m: sorted(list({s.find(m, e)+1 for e, i in enumerate(range(len(s))) if s.find(m, e) != -1}))

def motif_locator(s, m):
    return [i+1 for i in range(len(s)-len(m)+1) if s[i:i+len(m)]==m]