CoolFace
Datasetpublic

TheRealSamuel/LeetCodeProblem

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes572downloads
1{2    "id": 3799,3    "name": "unique_3_digit_even_numbers",4    "difficulty": "Easy",5    "link": "https://leetcode.com/problems/unique-3-digit-even-numbers/",6    "date": "2025-03-01 00:00:00",7    "task_description": "You are given an array of digits called `digits`. Your task is to determine the number of **distinct** three-digit even numbers that can be formed using these digits. **Note**: Each _copy_ of a digit can only be used **once per number**, and there may **not** be leading zeros. **Example 1:** **Input:** digits = [1,2,3,4] **Output:** 12 **Explanation:** The 12 distinct 3-digit even numbers that can be formed are 124, 132, 134, 142, 214, 234, 312, 314, 324, 342, 412, and 432. Note that 222 cannot be formed because there is only 1 copy of the digit 2. **Example 2:** **Input:** digits = [0,2,2] **Output:** 2 **Explanation:** The only 3-digit even numbers that can be formed are 202 and 220. Note that the digit 2 can be used twice because it appears twice in the array. **Example 3:** **Input:** digits = [6,6,6] **Output:** 1 **Explanation:** Only 666 can be formed. **Example 4:** **Input:** digits = [1,3,5] **Output:** 0 **Explanation:** No even 3-digit numbers can be formed. **Constraints:** `3 <= digits.length <= 10` `0 <= digits[i] <= 9`",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "digits = [1,2,3,4]",12            "output": "12 "13        },14        {15            "label": "Example 2",16            "input": "digits = [0,2,2]",17            "output": "2 "18        },19        {20            "label": "Example 3",21            "input": "digits = [6,6,6]",22            "output": "1 "23        },24        {25            "label": "Example 4",26            "input": "digits = [1,3,5]",27            "output": "0 "28        }29    ],30    "private_test_cases": [31        {32            "input": [33                7,34                9,35                2,36                137            ],38            "output": 639        },40        {41            "input": [42                1,43                7,44                4,45                7,46                8,47                4,48                7,49                2,50                251            ],52            "output": 5953        },54        {55            "input": [56                1,57                3,58                159            ],60            "output": 061        },62        {63            "input": [64                4,65                8,66                0,67                3,68                0,69                1,70                771            ],72            "output": 5773        },74        {75            "input": [76                3,77                3,78                1,79                8,80                8,81                5,82                4,83                584            ],85            "output": 3786        }87    ],88    "haskell_template": "totalNumbers :: [Int] -> Int\ntotalNumbers digits ",89    "ocaml_template": "let totalNumbers (digits: int list) : int =  ",90    "scala_template": "def totalNumbers(digits: List[Int]): Int = { \n    \n}",91    "java_template": "class Solution {\n    public int totalNumbers(int[] digits) {\n        \n    }\n}",92    "python_template": "class Solution(object):\n    def totalNumbers(self, digits):\n        \"\"\"\n        :type digits: List[int]\n        :rtype: int\n        \"\"\"\n        "93}