You're given a string of dominos. For each slot, there are 3 options:

  * "|" represents a standing domino

  * "/" represents a knocked over domino

  * " " represents a space where there is no domino

For example: 

```python
"||| ||||//| |/"
```

What you must do is find the resulting string if the first domino is pushed over. Now, tipping a domino will cause the next domino to its right to fall over as well, but if a domino is already tipped over, or there is a domino missing, the reaction will stop.

So in out example above, the result would be:

"/// ||||//| |/"

since the reaction would stop as soon as it gets to a space.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def domino_reaction(s):
	

Solutions:
def domino_reaction(s):
	ds = ''
	for (i, d) in enumerate(s):
		if d == '|':
			ds += '/'
		else:
			return ds + s[i:]
	return ds


def domino_reaction(s):
	return s.replace('|', '/', min(len(s.split(' ')[0]), len(s.split('/')[0])))


def domino_reaction(s):
	return (len(s) - len(s.lstrip('|'))) * '/' + s.lstrip('|')


def domino_reaction(s):
	i = next((i for (i, c) in enumerate(s) if c != '|'), len(s))
	return '/' * i + s[i:]


def domino_reaction(stg):
	return stg.replace('|', '/', len(stg) - len(stg.lstrip('|')))


import re

def domino_reaction(s):
	return re.sub('^\\|+', lambda m: '/' * len(m.group()), s, count=1)


import re

def domino_reaction(s):
	return re.sub('^[|]*', lambda x: len(x.group()) * '/', s)


def domino_reaction(s):
	return s.replace('|', '/', min([s.find(d) if s.find(d) != -1 else len(s) for d in ' /']))


def domino_reaction(s):
	p = s.find(' ')
	q = s.find('/')
	r = p if q == -1 else q if p == -1 else min(p, q)
	return s.replace('|', '/', r)


def domino_reaction(s):
	i = next((i for (i, j) in enumerate(s) if j in '/ '), len(s))
	return '/' * i + s[i:]