APPS

Contents

APPS#

Note

The Automated Programming Progress Standard, abbreviated APPS, consists of 10,000 coding problems in total, with 131,777 test cases for checking solutions and 232,421 ground-truth solutions written by humans. The data are split evenly into training and test sets, with 5,000 problems each.
The problems are curated from open-access sites where programmers share problems with each other, including Codewars, AtCoder, Kattis, and Codeforces.

../_images/apps1.png

Example#

  • metadata.json

{"difficulty": "introductory", "url": "https://www.codewars.com/kata/5a4d303f880385399b000001"}
  • question.txt

# 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 !!
  • starter_code.py

def strong_num(number):
    
  • input_output.json

{"fn_name": "strong_num", "inputs": [[40585], [2999999]], "outputs": [["STRONG!!!!"], ["Not Strong !!"]]}
  • solutions.json

[
    "import math\n\ndef strong_num(number):\n    return \"STRONG!!!!\" if sum(math.factorial(int(i)) for i in str(number)) == number else \"Not Strong !!\"",
    "STRONGS = {1, 2, 145, 40585}\n\ndef strong_num(number):\n    return \"STRONG!!!!\" if number in STRONGS else \"Not Strong !!\""
]