# Definition

**_Strong number_** is the number that *the sum of the factorial of its digits is equal to number itself*.

## **_For example_**:  **_145_**, since 
```
1! + 4! + 5! = 1 + 24 + 120 = 145
```
So, **_145_** is a **_Strong number_**. 
____

# Task

**_Given_** a number, **_Find if it is Strong or not_**.
____

# Warm-up (Highly recommended)

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

# Notes 

* **_Number_** *passed is always*  **_Positive_**.
* **_Return_** *the result as* **_String_**
___

# Input >> Output Examples


```
strong_num(1) ==> return "STRONG!!!!"
```

## **_Explanation_**:

Since , **_the sum of its digits' factorial of (1) is equal to number itself (1)_** , **_Then_** its a **_Strong_** .  
____

```
strong_num(123) ==> return "Not Strong !!"
```

## **_Explanation_**:

Since **_the sum of its digits' factorial of 1! + 2! + 3! = 9 is not equal to number itself (123)_** , **_Then_** it's  **_Not Strong_** . 
___

```
strong_num(2)  ==>  return "STRONG!!!!"
```

## **_Explanation_**:

Since **_the sum of its digits' factorial of 2! = 2 is equal to number itself (2)_** , **_Then_** its a **_Strong_** .  
____

```
strong_num(150) ==> return "Not Strong !!"
```

## **_Explanation_**:

Since **_the sum of its digits' factorial of 1! + 5! + 0! = 122 is not equal to number itself (150)_**, **_Then_** it's **_Not Strong_** . 
___
___
___

# [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)

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

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code:
def strong_num(number):
	

Solutions:
import math

def strong_num(number):
	return 'STRONG!!!!' if sum((math.factorial(int(i)) for i in str(number))) == number else 'Not Strong !!'


STRONGS = {1, 2, 145, 40585}

def strong_num(number):
	return 'STRONG!!!!' if number in STRONGS else 'Not Strong !!'


from math import factorial

def strong_num(number):
	return ('Not Strong !!', 'STRONG!!!!')[sum((factorial(int(i)) for i in str(number))) == number]


from math import factorial

def strong_num(n):
	return ['Not Strong !!', 'STRONG!!!!'][n == sum((factorial(int(d)) for d in str(n)))]


factorial = lambda n: 1 if n == 0 else n * factorial(n - 1)

def strong_num(n):
	if sum((factorial(int(n)) for n in str(n))) == n:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):
	fac = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]
	digits = sorted([int(i) for i in str(number)])
	digits.reverse()
	s = 0
	for i in digits:
		s += fac[i]
		if s > number:
			return 'Not Strong !!'
	return 'STRONG!!!!' if number == s else 'Not Strong !!'


def strong_num(n):
	import math
	s = str(n)
	l = map(int, s[:])
	return 'STRONG!!!!' if sum(map(math.factorial, l)) == n else 'Not Strong !!'


import math

def strong_num(number):
	return ('Not Strong !!', 'STRONG!!!!')[sum((math.factorial(int(n)) for n in str(number))) == number]


from math import factorial as f

def strong_num(n):
	c = sum(map(lambda _: f(_), (int(i) for i in str(n)))) == n
	return 'STRONG!!!!' if c else 'Not Strong !!'


def strong_num(number):
	result = []
	for i in str(number):
		fact = 1
		for j in range(1, int(i) + 1):
			fact = fact * j
		result.append(fact)
	return 'STRONG!!!!' if sum(result) == number else 'Not Strong !!'


import math

def strong_num(number):
	d = [int(d) for d in str(number)]
	b = sum([math.factorial(x) for x in d])
	if b == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


def strong_num(n):
	if n == 40585:
		return 'STRONG!!!!'

	def get_f(n):
		out = {0: 0, 1: 1}
		if n < 2:
			return out
		for i in range(2, max([int(x) for x in str(n)]) + 1):
			out[i] = out[i - 1] * i
		return out
	d = get_f(n)
	return 'STRONG!!!!' if n == sum([d[int(x)] for x in str(n)]) else 'Not Strong !!'


from math import factorial

def strong_num(number):
	strong = number == sum((factorial(int(digit)) for digit in str(number)))
	return 'STRONG!!!!' if strong else 'Not Strong !!'


def fac(nb):
	if nb == 0:
		return 1
	res = 1
	for i in range(1, nb + 1):
		res *= i
	return res

def strong_num(number):
	nb = [int(x) for x in str(number)]
	r = 0
	for i in nb:
		r += fac(i)
	if number == r:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):
	return ('Not Strong !!', 'STRONG!!!!')[number == sum([[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880][int(x)] for x in str(number)])]


def strong_num(n):
	return 'STRONG!!!!' if sum((__import__('math').factorial(int(i)) for i in str(n))) == n else 'Not Strong !!'


from numpy import prod

def strong_num(n):
	return ['Not Strong !!', 'STRONG!!!!'][sum((prod(range(1, i + 1)) for i in map(int, str(n)))) == n]


import math

def strong_num(number):
	result = 0
	number1 = number
	number2 = []
	while number1 > 0.99:
		number2.append(number1 % 10)
		number1 = int(number1 / 10)
	for i in number2:
		if i == 0:
			result += 1
		else:
			result += math.factorial(i)
	if result == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


def strong_num(number):
	sum = 0
	for i in map(int, str(number)):
		temp = 1
		for j in range(i, 1, -1):
			temp *= j
		sum += temp
	print(number, sum)
	if number == sum:
		return 'STRONG!!!!'
	return 'Not Strong !!'


from math import factorial

def strong_num(number):
	arr = [int(i) for i in str(number)]
	x = 0
	for i in arr:
		x += factorial(i)
	if x == number:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):
	o = 0
	s = 0
	strong = 'STRONG!!!!'
	nstrong = 'Not Strong !!'
	for i in str(number):
		o = 1
		while int(i) > 0:
			o *= int(i)
			i = int(i) - 1
		s = s + o
	if number == s:
		return strong
	else:
		return nstrong


from math import factorial

def strong_num(N):
	sum = 0
	P = N
	for i in range(len(str(N))):
		sum += factorial(N // 10 ** (len(str(N)) - 1))
		N = N % 10 ** (len(str(N)) - 1)
	return 'STRONG!!!!' if P == sum else 'Not Strong !!'


def strong_num(number):
	total = 0
	for n in str(number):
		total += factorial(n)
	return 'STRONG!!!!' if total == number else 'Not Strong !!'

def factorial(number):
	number = int(number)
	if number < 2:
		return 1
	else:
		return number * factorial(number - 1)


import operator

def strong_num(number):
	return 'STRONG!!!!' if number in [1, 2, 145, 40585] else 'Not Strong !!'


def strong_num(number):

	def factorial(n):
		if n < 2:
			return 1
		else:
			return n * factorial(n - 1)
	if sum([factorial(int(i)) for i in str(number)]) == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


import math

def strong_num(number):
	print()
	a = list(str(number))
	a = [int(x) for x in a]
	print(a)
	t = 0
	for x in a:
		print(x)
		t += math.factorial(x)
	b = [str(x) for x in a]
	b = ''.join(b)
	if t == int(b):
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


from math import factorial

def strong_num(n):
	print(n)
	return ['Not Strong !!', 'STRONG!!!!'][n == sum(map(factorial, [int(x) for x in str(n)]))]


def strong_num(n):
	if n in [1, 2, 145, 40585]:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def factorial(n):
	if n == 0 or n == 1:
		return 1
	else:
		return n * factorial(n - 1)

def strong_num(number):
	result = 0
	numLst = [int(x) for x in str(number)]
	for i in range(len(numLst)):
		result += factorial(numLst[i])
	return 'STRONG!!!!' if result == number else 'Not Strong !!'


def factorial(n):
	acc = 1
	for i in range(1, n + 1):
		acc = acc * i
	return acc

def strong_num(num):
	rs = list(map(int, str(num)))
	r = [factorial(i) for i in rs]
	return 'STRONG!!!!' if sum(r) == num else 'Not Strong !!'


def strong_num(number):

	def fact(n):
		if n == 0:
			return 1
		if n == 1:
			return 1
		return n * fact(n - 1)
	if sum((fact(int(i)) for i in str(number))) == number:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):
	sm = 0
	for num in str(number):
		fact = 1
		for en in range(1, int(num) + 1):
			fact *= en
		sm += fact
	if sm == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


from math import factorial

def strong_num(number):
	sf = sum((factorial(int(c)) for c in str(number)))
	return 'STRONG!!!!' if sf == number else 'Not Strong !!'


def strong_num(number):
	Digits = list(map(int, list(str(number))))
	SumFactorial = 0
	for i in Digits:
		Factorial = 1
		for x in range(1, i + 1):
			Factorial *= x
		SumFactorial += Factorial
	if SumFactorial == number:
		return 'STRONG!!!!'
	else:
		print(number)
		return 'Not Strong !!'


from math import factorial

def strong_num(number):
	sum = 0
	for el in str(number):
		sum += factorial(int(el))
	if sum == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


import math

def strong_num(number):
	n = list(map(int, str(number)))
	lst = [math.factorial(i) for i in n]
	return 'STRONG!!!!' if sum(lst) == number else 'Not Strong !!'


def fac(n):
	r = 1
	for x in range(1, n + 1):
		r *= x
	return r

def strong_num(n):
	return 'STRONG!!!!' if sum([fac(int(x)) for x in str(n)]) == n else 'Not Strong !!'


memo = {}

def factorial(n):
	if n in memo.keys():
		return memo[n]
	elif n == 0:
		return 1
	else:
		ans = n * factorial(n - 1)
		memo[n] = ans
	return ans

def strong_num(number):
	play = str(number)
	add = 0
	for num in play:
		add += factorial(int(num))
	if add == number:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):
	sum = 0
	for i in str(number):
		a = 1
		j = 1
		while j < int(i) + 1:
			a *= j
			j += 1
		sum += a
	if sum == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


from functools import lru_cache

def strong_num(number):

	@lru_cache()
	def factorial(n):
		if n <= 1:
			return 1
		else:
			print(n)
			return factorial(n - 1) * n
	return 'STRONG!!!!' if sum((factorial(int(x)) for x in str(number))) == number else 'Not Strong !!'


from math import factorial

def strong_num(number):
	s = str(number)
	return 'STRONG!!!!' if sum((factorial(int(n)) for n in s)) == number else 'Not Strong !!'


from math import factorial as f

def strong_num(number):
	factors = [f(int(x)) for x in str(number)]
	return 'STRONG!!!!' if sum(factors) == number else 'Not Strong !!'


from math import factorial as f

def strong_num(n):
	return ['Not Strong !!', 'STRONG!!!!'][sum((f(i) for i in map(int, str(n)))) == n]


from math import factorial as f

def strong_num(number):
	return ['Not Strong !!', 'STRONG!!!!'][number == sum((f(int(d)) for d in str(number)))]


def strong_num(number):
	n = 0
	for i in str(number):
		m = 1
		for x in range(1, int(i) + 1):
			m *= x
		n += m
	if number == n:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


def strong_num(number):
	c = 0
	f = 1
	num = str(number)
	for i in num:
		i = int(i)
		for e in range(1, i + 1):
			f = f * e
		c = c + f
		f = 1
	if c == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


from math import factorial

def strong_num(number):
	print(number)
	a = str(number)
	count = 0
	for i in range(len(a)):
		if i != len(a):
			count += factorial(int(a[i]))
	print(count)
	return 'STRONG!!!!' if count == number else 'Not Strong !!'


def strong_num(number):
	sum1 = 0
	for i in str(number):
		num = 1
		a = int(i)
		for i in range(1, a + 1):
			num = num * i
		sum1 += num
	if number == sum1:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):
	w = [int(i) for i in str(number)]
	res = []
	for i in w:
		f = 1
		for q in range(1, i + 1):
			f *= q
		res.append(f)
	z = sum(res)
	t = ''.join(str(z))
	if str(number) == t:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


def strong_num(number):
	res = []
	for x in str(number):
		num = 1
		for y in range(1, int(x) + 1):
			num *= y
		res.append(num)
	return 'STRONG!!!!' if sum(res) == number else 'Not Strong !!'


import math

def strong_num(number):
	nums = [int(char) for char in str(number)]
	strong = 0
	for i in nums:
		strong += math.factorial(i)
	if strong == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


def strong_num(number):
	ln = [int(x) for x in str(number)]
	ln = [1 if x == 0 else x for x in ln]
	f = 1
	ff = []
	for d in ln:
		for x in range(1, d + 1):
			f *= x
		ff.append(f)
		f = 1
	if number == int(sum(ff)):
		return 'STRONG!!!!'
	return 'Not Strong !!'


def strong_num(number):

	def factorial(n):
		if n == 0:
			return 1
		else:
			output = 1
			for i in range(1, n + 1):
				output *= i
			return output
	suma = 0
	for num in str(number):
		suma += factorial(int(num))
	if suma == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


def strong_num(number):
	str_num = list(str(number))
	a = 0
	for i in str_num:
		f = 1
		j = int(i)
		if j != 0:
			for k in range(1, j + 1):
				f *= k
		a += f
	if a == number:
		return 'STRONG!!!!'
	return 'Not Strong !!'


from math import factorial as fact

def strong_num(n):
	return 'STRONG!!!!' if sum((fact(int(c)) for c in str(n))) == n else 'Not Strong !!'


def strong_num(number):
	number_list = [int(i) for i in str(number)]
	strong_list = []
	for i in number_list:
		res = 1
		for i in range(1, i + 1):
			res *= i
		strong_list.append(res)
	return 'STRONG!!!!' if sum(strong_list) == number else 'Not Strong !!'


from math import factorial

def strong_num(number: int) -> str:
	return 'STRONG!!!!' if number == sum(map(factorial, list(map(int, str(number))))) else 'Not Strong !!'


def strong_num(number):

	def factorial(n):
		factorial = 1
		for x in range(1, int(n) + 1):
			factorial = factorial * x
		return factorial
	s = 0
	for digit in str(number):
		s += factorial(digit)
	if s == number:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'


from math import factorial
facs = {str(n): factorial(n) for n in range(10)}

def strong_num(number):
	return 'STRONG!!!!' if number == sum((facs[d] for d in str(number))) else 'Not Strong !!'


from math import factorial

def strong_num(number):
	return ['Not Strong !!', 'STRONG!!!!'][sum(map(lambda x: factorial(int(x)), str(number))) == number]


from functools import lru_cache

@lru_cache(maxsize=None)
def fac(number):
	if number in [0, 1]:
		return 1
	else:
		return number * fac(number - 1)

def strong_num(number):
	numbers = [int(n) for n in str(number)]
	flag = sum((fac(n) for n in numbers)) == number
	return 'STRONG!!!!' if flag else 'Not Strong !!'


from math import factorial
strong_num = lambda n: 'STRONG!!!!' if n == sum((factorial(int(d)) for d in str(n))) else 'Not Strong !!'


from math import factorial

def strong_num(number):
	s = 0
	for x in str(number):
		s += factorial(int(x))
	return 'STRONG!!!!' if s == number else 'Not Strong !!'


def strong_num(n):
	print(n)
	g = []
	z = [int(x) for x in str(n)]
	print(z)
	for i in z:
		if i >= 0:
			fac = 1
			for y in range(1, i + 1):
				fac = fac * y
			g.append(fac)
	print(g)
	h = sum(g)
	if h == n:
		mystr = 'STRONG!!!!'
	if h != n:
		mystr = 'Not Strong !!'
	return mystr


fact = [1]
for i in range(1, 10):
	fact.append(i * fact[i - 1])

def strong_num(number):
	total = 0
	tmp = number
	while tmp > 0:
		total += fact[tmp % 10]
		tmp = int(tmp / 10)
	if total == number:
		return 'STRONG!!!!'
	return 'Not Strong !!'


def fact(n):
	p = 1
	while n > 0:
		p = p * n
		n = n - 1
	return p

def strong_num(number):
	tot = 0
	numberc = number
	while number > 0:
		digit = number % 10
		tot = tot + fact(digit)
		number = number // 10
	if tot == numberc:
		return 'STRONG!!!!'
	else:
		return 'Not Strong !!'