FPEvalDataset/LeetCodeProblem
0305
1{2 "id": 3548,3 "name": "find_the_count_of_good_integers",4 "difficulty": "Hard",5 "link": "https://leetcode.com/problems/find-the-count-of-good-integers/",6 "date": "2024-08-17 00:00:00",7 "task_description": "You are given two **positive** integers `n` and `k`. An integer `x` is called **k-palindromic** if: `x` is a palindrome. `x` is divisible by `k`. An integer is called **good** if its digits can be _rearranged_ to form a **k-palindromic** integer. For example, for `k = 2`, 2020 can be rearranged to form the _k-palindromic_ integer 2002, whereas 1010 cannot be rearranged to form a _k-palindromic_ integer. Return the count of **good** integers containing `n` digits. **Note** that _any_ integer must **not** have leading zeros, **neither** before **nor** after rearrangement. For example, 1010 _cannot_ be rearranged to form 101. **Example 1:** **Input:** n = 3, k = 5 **Output:** 27 **Explanation:** _Some_ of the good integers are: 551 because it can be rearranged to form 515. 525 because it is already k-palindromic. **Example 2:** **Input:** n = 1, k = 4 **Output:** 2 **Explanation:** The two good integers are 4 and 8. **Example 3:** **Input:** n = 5, k = 6 **Output:** 2468 **Constraints:** `1 <= n <= 10` `1 <= k <= 9`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "n = 3, k = 5",12 "output": "27 "13 },14 {15 "label": "Example 2",16 "input": "n = 1, k = 4",17 "output": "2 "18 },19 {20 "label": "Example 3",21 "input": "n = 5, k = 6",22 "output": "246"23 }24 ],25 "private_test_cases": [26 {27 "input": [28 2,29 430 ],31 "output": 232 },33 {34 "input": [35 9,36 637 ],38 "output": 1247669639 },40 {41 "input": [42 10,43 544 ],45 "output": 1928485646 },47 {48 "input": [49 4,50 551 ],52 "output": 5253 },54 {55 "input": [56 10,57 158 ],59 "output": 4145702460 },61 {62 "input": [63 7,64 565 ],66 "output": 18233567 },68 {69 "input": [70 4,71 772 ],73 "output": 7674 },75 {76 "input": [77 4,78 379 ],80 "output": 8481 },82 {83 "input": [84 5,85 186 ],87 "output": 1093588 },89 {90 "input": [91 9,92 893 ],94 "output": 3077154395 }96 ],97 "haskell_template": "countGoodIntegers :: Int -> Int -> Int\ncountGoodIntegers n k ",98 "ocaml_template": "let countGoodIntegers (n: int) (k: int) : int = ",99 "scala_template": "def countGoodIntegers(n: Int,k: Int): Int = { \n \n}",100 "java_template": "class Solution {\n public long countGoodIntegers(int n, int k) {\n \n }\n}",101 "python_template": "class Solution(object):\n def countGoodIntegers(self, n, k):\n \"\"\"\n :type n: int\n :type k: int\n :rtype: int\n \"\"\"\n "102}