Your friend Cody has to sell a lot of jam, so he applied a good 25% discount to all his merchandise.

Trouble is that he mixed all the prices (initial and discounted), so now he needs your cool coding skills to filter out only the discounted prices.

For example, consider this inputs:
```
"15 20 60 75 80 100"
"9 9 12 12 12 15 16 20"
```
They should output:
```
"15 60 75"
"9 9 12 15"
```
Every input will always have all the prices in pairs (initial and discounted) sorted from smaller to bigger.

You might have noticed that the second sample input can be tricky already; also, try to have an eye for performances, as huge inputs could be tested too.

***Final Note:*** kata blatantly taken from [this problem](https://code.google.com/codejam/contest/8274486/dashboard) (and still not getting why they created a separated Code Jam for ladies, as I find it rather discriminating...), this kata was created inspired by two of the talented girls I am coaching thanks to [codebar](https://codebar.io/) :)

Source: codewars | Difficulty: EASY
Tags: Data structures

Starter code: def find_discounted(prices):
	

Solutions:
from bisect import bisect_left
from collections import deque

def find_discounted(prices: str) -> str:
	all_prices = deque(list(map(int, prices.split())))
	discounts = []
	while all_prices:
		d = all_prices.popleft()
		discounts.append(d)
		del all_prices[bisect_left(all_prices, d * 4 // 3)]
	return ' '.join(map(str, discounts))


def find_discounted(prices):
	prices = [int(n) for n in prices.split()]
	return ' '.join((prices.remove(round(p * 4 / 3)) or str(p) for p in prices))


from collections import Counter

def find_discounted(s):
	s = list(map(int, s.split()))
	(c, li) = (Counter(s), [])
	for i in s:
		i = int(i)
		ans = i - i * 0.25
		if c.get(ans, 0):
			li.append(str(int(ans)))
			c[ans] -= 1
			c[i] -= 1
	return ' '.join(li)


from collections import Counter

def find_discounted(prices):
	count_prices = Counter((int(a) for a in prices.split()))
	result = []
	for key in sorted(count_prices):
		value = count_prices[key]
		try:
			count_prices[int(key / 0.75)] -= value
		except KeyError:
			continue
		result.extend((key for _ in range(value if key else 1)))
	return ' '.join((str(b) for b in result))


def find_discounted(prices):
	discount = 0.25
	in_list = [int(p) for p in prices.split()]
	out_list = []
	while in_list:
		full_price = in_list.pop()
		discounted_price = int(full_price * (1 - discount))
		in_list.remove(discounted_price)
		out_list.append(discounted_price)
	out_list.reverse()
	ans = ' '.join((str(p) for p in out_list))
	return ans


def find_discounted(prices):
	if prices == '':
		return ''
	out = []
	prices = [int(x) for x in prices.split(' ')]
	for price in prices:
		if int(price / 0.75) in prices:
			prices.remove(int(price / 0.75))
			out.append(str(price))
	return ' '.join(out)


def find_discounted(prices):
	prices = list(map(int, prices.split()))
	discounted = []
	while prices:
		price = prices.pop()
		discount = int(price * 0.75)
		prices.remove(discount)
		discounted.append(discount)
	return ' '.join(map(str, discounted[::-1]))