# Task

**_Given_** a **_Divisor and a Bound_** , *Find the largest integer N* , Such That , 

# Conditions :

* **_N_**  is *divisible by divisor*

* **_N_**  is *less than or equal to bound* 

* **_N_**  is *greater than 0*.
___

# Notes 

* The **_parameters (divisor, bound)_** passed to the function are *only positive values* .
* *It's guaranteed that* a **divisor is Found** .
___
# Input >> Output Examples 

```
maxMultiple (2,7) ==> return (6)
```
## Explanation: 

**_(6)_** is divisible by **_(2)_** , **_(6)_** is less than or equal to bound **_(7)_** , and **_(6)_** is > 0 .
___
```
maxMultiple (10,50)  ==> return (50)
```
## Explanation:

**_(50)_** *is divisible by* **_(10)_** , **_(50)_** is less than or equal to bound **_(50)_** , and **_(50)_** is > 0 .*
___
```
maxMultiple (37,200) ==> return (185)
```
## Explanation:

**_(185)_** is divisible by **_(37)_** , **_(185)_** is less than or equal to bound **_(200)_** , and **_(185)_** is > 0 .
___
___

## [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)

# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)

# [Bizarre Sorting-katas](https://www.codewars.com/collections/bizarre-sorting-katas)

# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)
___

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

~~~if:java
Java's default return statement can be any `int`, a divisor **will** be found.
~~~

~~~if:nasm
## NASM-specific notes

The function declaration is `int max_multiple(int divisor, int bound)` where the first argument is the divisor and the second one is the bound.
~~~

Difficulty: EASY
Tags: Fundamentals

Starter code:
def max_multiple(divisor, bound):
	

Solutions:
def max_multiple(divisor, bound):
	return bound - bound % divisor


max_multiple = lambda divisor, bound: bound - bound % divisor


def max_multiple(divisor, bound):
	l = []
	for int in range(bound + 1):
		if int % divisor == 0:
			l.append(int)
	return max(l)


def max_multiple(divisor, bound):
	m = bound // divisor
	return divisor * m


def max_multiple(divisor, bound):
	n = bound
	while n >= divisor:
		if n % divisor == 0:
			return n
		else:
			n -= 1
	if n < divisor:
		return 0


def max_multiple(divisor, bound):
	return divisor * int(bound / divisor)


def max_multiple(divisor, bound):
	return max([n for n in range(1, bound + 1) if n % divisor == 0])


def max_multiple(divisor, bound):
	(last, n) = (0, 0)
	while n <= bound:
		last = [n, last][n % divisor]
		n += divisor
	return last


def max_multiple(d, b):
	L = []
	for i in range(0, b + 1):
		if i % d == 0:
			L.append(i)
	return max(L)


def max_multiple(divisor, bound):
	return next((i for i in range(bound, 0, -1) if i % divisor == 0))


def max_multiple(d, b):
	return b // d * d


def max_multiple(divisor, bound):
	for x in reversed(range(bound + 1)):
		if x % divisor == 0:
			return x
	return 0


def max_multiple(divisor, bound):
	return [x for x in range(divisor * 2, bound + 1, divisor)][-1]


def max_multiple(divisor, bound):
	multiple = bound // divisor
	return multiple * divisor


def max_multiple(divisor, bound):
	while bound:
		if not bound % divisor:
			return bound
		bound -= 1


def max_multiple(divisor, bound):
	a = bound % divisor
	return bound - a


def max_multiple(divisor, bound):
	(a, r) = divmod(bound, divisor)
	return bound - r


def max_multiple(divisor, bound):
	return max(range(divisor, bound + 1, divisor))


import random

def max_multiple(divisor, bound):
	x = int(bound / divisor)
	a = divisor * x
	return a


from math import floor

def max_multiple(divisor, bound):
	return floor(bound / divisor) * divisor


def max_multiple(divisor, bound):
	ans = []
	for x in range(1, bound + 1):
		if x % divisor == 0:
			ans.append(x)
	return max(ans)


def max_multiple(d, b):
	l = 0
	for i in range(d, b + 1):
		if i % d == 0:
			if i > l:
				l = i
	return l


def max_multiple(snail, snails):
	return snails // snail * snail


def max_multiple(divisor, bound):
	while bound > divisor:
		if bound % divisor == 0:
			return bound
		bound -= 1


def max_multiple(divisor, bound):
	array = [i for i in range(1, bound + 1)]
	array.reverse()
	for n in array:
		if n % divisor == 0:
			return n


def max_multiple(divisor, bound):
	num_lst = []
	for i in range(1, bound + 1):
		if i % divisor == 0:
			num_lst.append(i)
	return num_lst[-1]


def max_multiple(d, b):
	for n in range(b + 1, d, -1):
		if n % d == 0 and n <= b:
			return n


def max_multiple(divisor, bound):
	if bound % divisor == 0:
		return bound
	else:
		x = int(bound / divisor)
		return divisor * x


def max_multiple(divisor, bound):
	for num in range(bound, 0, -1):
		print(num)
		if num % divisor == 0:
			return num


def max_multiple(divisor, bound):
	return max(list((i for i in range(1, bound + 1) if i % divisor == 0)))


import math

def max_multiple(divisor, bound):
	if bound % divisor == 0:
		return bound
	else:
		nearestFactor = math.floor(bound / divisor)
		return divisor * nearestFactor


def max_multiple(divisor, bound):
	for loop in range(bound, 0, -1):
		if loop % divisor == 0 and loop > 0:
			return loop


def max_multiple(divisor, bound):
	new = []
	for n in range(1000000):
		if n % divisor == 0 and n <= bound:
			new.append(n)
	return max(new)


def max_multiple(divisor, bound):
	temp = max([i for i in range(divisor, bound + 1) if i % divisor == 0 and i <= bound and (i > 0)])
	return temp


def max_multiple(divisor, bound):
	valid_list = []
	for n in range(1, bound + 1):
		if n % divisor == 0:
			valid_list.append(n)
	valid_list = sorted(valid_list)
	return valid_list[-1]


def max_multiple(divisor, bound):
	n = bound
	while n % divisor != 0:
		n -= 1
		if n % divisor == 0:
			break
	return n


def max_multiple(divisor, bound):
	lista = [i for i in range(1, bound + 1)]
	lista.reverse()
	for i in lista:
		if i % divisor == 0:
			return i


def max_multiple(a, b):
	res = 0
	for i in range(b + 1):
		if i % a == 0:
			if i > res:
				res = i
	return res
print(max_multiple(10, 50))


def max_multiple(divisor, bound):
	num = []
	for x in range(divisor, bound + 1):
		if x % divisor == 0 and x <= bound and (x > 0):
			num.append(x)
	return max(num)


def max_multiple(divisor, bound):
	r = []
	for i in range(bound + 1):
		if i % divisor == 0:
			r.append(i)
	return max(r)


def max_multiple(divisor, bound):
	a = bound
	print((divisor, a))
	while a > divisor:
		if a % divisor == 0 and a > 0:
			return a
		else:
			a = a - 1
			if a % divisor == 0 and a > 0:
				return a


def max_multiple(divisor, bound):
	s = [x for x in range(1, bound + 1) if x % divisor == 0 and x <= bound]
	return max(s)


def max_multiple(divisor, bound):
	while bound > 0 and bound % divisor != 0:
		bound += -1
	return bound


def max_multiple(divisor, bound):
	for num in range(bound):
		if not (bound - num) % divisor:
			return bound - num


def max_multiple(divisor, bound):
	for n in range(divisor, bound):
		if bound % divisor == 0:
			return bound
		elif n % divisor == 0 and n <= bound and (n + divisor > bound):
			return n


def max_multiple(divisor, bound):
	i = bound
	while i > 1:
		if i % divisor == 0 and i <= bound:
			return i
		i -= 1


def max_multiple(divisor, bound):
	n = bound
	while n > 0:
		if n % divisor == 0:
			return n
		n -= 1
	return None


def max_multiple(divisor, bound):
	valid = []
	for i in range(bound + 1):
		if i % divisor == 0:
			valid.append(i)
	return valid[len(valid) - 1]


def max_multiple(divisor, bound):
	multiple = 0
	while multiple <= bound:
		multiple += divisor
		print(multiple)
	return multiple - divisor


def max_multiple(divisor, bound):
	return max((x for x in range(0, bound + 1) if x % divisor == 0))
print(max_multiple(5, 23))


def max_multiple(divisor, bound):
	higher = 0
	for diviser in range(divisor, bound + 1):
		if diviser % divisor == 0 and diviser > higher:
			higher = diviser
	return higher


def max_multiple(divisor, bound):
	x = []
	for n in range(divisor, bound + 1):
		if n % divisor == 0 and n <= bound and (n > 0):
			x.append(n)
		else:
			pass
	return max(x)


def max_multiple(divisor, bound):
	n = 1
	while n <= bound:
		if n % divisor == 0:
			abc = n
		else:
			pass
		n += 1
	return abc


def max_multiple(divisor, bound):
	lst = []
	for num in range(divisor, bound + 1):
		if num % divisor == 0:
			if num <= bound:
				lst.append(num)
	return lst[-1]


def max_multiple(divisor, bound):
	i = 1
	while True:
		if divisor * i > bound:
			return divisor * (i - 1)
		else:
			i = i + 1


def max_multiple(divisor, bound):
	nums = list(range(1, bound + 1))
	nums = reversed(nums)
	for n in nums:
		if n % divisor == 0:
			return n


def max_multiple(divisor, bound):
	return max([x for x in range(1, bound + 1) if not x % divisor])


def max_multiple(d, b):
	import math
	return d * math.floor(b / d)


def max_multiple(divisor, bound):
	N = 1
	list1 = list(range(1, bound + 1))
	for N1 in list1:
		if N1 % divisor == 0:
			if N < N1:
				N = N1
	return N


def max_multiple(divisor, bound):
	iter = 1
	lst = []
	mul = 1
	while mul <= bound:
		mul = iter * divisor
		lst.append(mul)
		iter += 1
	return lst[-2]


def max_multiple(d, b):
	return max([x for x in range(1, b + 1) if x % d == 0])


def max_multiple(divisor, bound):
	return max([num for num in range(0, bound + 1, divisor)])


def max_multiple(d, b):
	i = 1
	start = d
	while d <= b:
		d /= i
		i += 1
		d *= i
	return d - start


def max_multiple(divisor, bound):
	number = divisor
	while divisor <= bound:
		divisor += number
	return divisor - number


def max_multiple(divisor, bound):
	i = bound
	while i != 0:
		if i % divisor != 0:
			i = i - 1
		else:
			return i


def max_multiple(divisor, bound):
	total = 0
	while total <= bound:
		total += divisor
	return total - divisor


def max_multiple(a, b):
	while b % a != 0:
		b -= 1
	return b


def max_multiple(divisor, bound):
	i = bound
	while True:
		if i % divisor == 0:
			return i
		i -= 1


def max_multiple(divisor, bound):
	a = bound
	while True:
		if a % divisor == 0:
			return a
		else:
			a -= 1


def max_multiple(divisor, bound):
	my_num = 0
	for item in range(1, bound + 1):
		if item % divisor == 0:
			my_num = item
	return my_num