|
Download misc/misc-0312.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 2.79 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/b5bf3ebebe22b46f4f78c2589a5bb814a44293a7/misc/misc-0312.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@b5bf3ebebe22b46f4f78c2589a5bb814a44293a7/misc/misc-0312.jsonl
-
curl -L -o misc-0312.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/b5bf3ebebe22b46f4f78c2589a5bb814a44293a7/misc/misc-0312.jsonl
2.79 kB
| {"type": "session", "harness": "opencode", "id": "misc-0312", "name": "Competitive Programming"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert competitive programmer. You solve problems by analyzing requirements, designing algorithms, and writing clean, efficient code. When solving problems, explain your reasoning step by step before providing the final solution."}} | |
| {"type": "message", "message": {"role": "user", "content": "# Definition\n\n**_Strong number_** is the number that *the sum of the factorial of its digits is equal to number itself*.\n\n## **_For example_**: **_145_**, since \n```\n1! + 4! + 5! = 1 + 24 + 120 = 145\n```\nSo, **_145_** is a **_Strong number_**. \n____\n\n# Task\n\n**_Given_** a number, **_Find if it is Strong or not_**.\n____\n\n# Warm-up (Highly recommended)\n\n# [Playing With Numbers Series](https://www.codewars.com/collections/playing-with-numbers)\n___\n\n# Notes \n\n* **_Number_** *passed is always* **_Positive_**.\n* **_Return_** *the result as* **_String_**\n___\n\n# Input >> Output Examples\n\n\n```\nstrong_num(1) ==> return \"STRONG!!!!\"\n```\n\n## **_Explanation_**:\n\nSince , **_the sum of its digits' factorial of (1) is equal to number itself (1)_** , **_Then_** its a **_Strong_** . \n____\n\n```\nstrong_num(123) ==> return \"Not Strong !!\"\n```\n\n## **_Explanation_**:\n\nSince **_the sum of its digits' factorial of 1! + 2! + 3! = 9 is not equal to number itself (123)_** , **_Then_** it's **_Not Strong_** . \n___\n\n```\nstrong_num(2) ==> return \"STRONG!!!!\"\n```\n\n## **_Explanation_**:\n\nSince **_the sum of its digits' factorial of 2! = 2 is equal to number itself (2)_** , **_Then_** its a **_Strong_** . \n____\n\n```\nstrong_num(150) ==> return \"Not Strong !!\"\n```\n\n## **_Explanation_**:\n\nSince **_the sum of its digits' factorial of 1! + 5! + 0! = 122 is not equal to number itself (150)_**, **_Then_** it's **_Not Strong_** . \n___\n___\n___\n\n# [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)\n\n# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)\n\n# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)\n___\n\n## ALL translations are welcomed\n\n## Enjoy Learning !!\n# Zizou\n\nStarter code:\ndef strong_num(number):\n\t"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "def strong_num(number):\n # Precompute factorials for digits 0-9\n factorials = [1] * 10\n for i in range(1, 10):\n factorials[i] = factorials[i-1] * i\n \n sum_fact = 0\n for d in str(number):\n sum_fact += factorials[int(d)]\n \n return \"STRONG!!!!\" if sum_fact == number else \"Not Strong !!\""}} | |