# Welcome to the Codewars Bar!

Codewars Bar recommends you drink 1 glass of water per standard drink so you're not hungover tomorrow morning.

Your fellow coders have bought you several drinks tonight in the form of a string. Return a string suggesting how many glasses of water you should drink to not be hungover.

## Examples

```
"1 beer"  =>  "1 glass of water"
"1 shot, 5 beers and 1 glass of wine"  =>  "7 glasses of water"
```

## Notes

* To keep the things simple, we'll consider that anything with a number in front of it is a drink: `"1 bear" => "1 glass of water"` or `"1 chainsaw and 2 pools" => "3 glasses of water"`
* The number in front of each drink lies in range `[1; 9]`

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def hydrate(drink_string):
	

Solutions:
def hydrate(drink_string):
	c = sum((int(c) for c in drink_string if c.isdigit()))
	return '{} {} of water'.format(c, 'glass') if c == 1 else '{} {} of water'.format(c, 'glasses')


import re

def hydrate(s):
	n = sum(map(int, re.findall('\\d+', s)))
	return f"{n} glass{'es' * (n != 1)} of water"


def hydrate(drink_string):
	n = sum([int(a) for a in drink_string if a.isnumeric()])
	return str(n) + ' glass of water' if n == 1 else str(n) + ' glasses of water'
	pass


def hydrate(drink_string):
	glasses = 0
	for word in drink_string.split():
		if word.isdigit():
			glasses += int(word)
	return str(glasses) + ' glass of water' if glasses == 1 else str(glasses) + ' glasses of water'


def hydrate(drink_string):
	c = 0
	for i in '123456789':
		c += int(i) * drink_string.count(i)
	k = 'glass' if c == 1 else 'glasses'
	return f'{c} {k} of water'


def hydrate(drinks):
	water = sum([int(drink) for drink in drinks if drink.isnumeric()])
	return '1 glass of water' if water == 1 else '%d glasses of water' % water


import re

def hydrate(drink_string):
	drink = sum((int(n) for n in re.findall('\\d', drink_string)))
	return f"{drink} glass{('es' if drink > 1 else '')} of water"


def hydrate(s):
	a = sum(map(int, filter(str.isdigit, s)))
	return f"{a} glass{['es', ''][a == 1]} of water"


def hydrate(drink_string):
	n = 0
	for i in range(len(drink_string)):
		try:
			n += int(drink_string[i])
		except:
			continue
	if n == 1:
		return '1 glass of water'
	else:
		return str(n) + ' glasses of water'


from re import compile
REGEX = compile('\\d+').findall

def hydrate(drink_string):
	res = sum(map(int, REGEX(drink_string)))
	return f"{res} glass{'es' * (res != 1)} of water"