CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes305downloads
1{2    "id": 2998,3    "name": "count_symmetric_integers",4    "difficulty": "Easy",5    "link": "https://leetcode.com/problems/count-symmetric-integers/",6    "date": "1693094400000",7    "task_description": "You are given two positive integers `low` and `high`. An integer `x` consisting of `2 * n` digits is **symmetric** if the sum of the first `n` digits of `x` is equal to the sum of the last `n` digits of `x`. Numbers with an odd number of digits are never symmetric. Return _the **number of symmetric** integers in the range_ `[low, high]`. **Example 1:** ``` **Input:** low = 1, high = 100 **Output:** 9 **Explanation:** There are 9 symmetric integers between 1 and 100: 11, 22, 33, 44, 55, 66, 77, 88, and 99. ``` **Example 2:** ``` **Input:** low = 1200, high = 1230 **Output:** 4 **Explanation:** There are 4 symmetric integers between 1200 and 1230: 1203, 1212, 1221, and 1230. ``` **Constraints:** `1 <= low <= high <= 104`",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "low = 1, high = 100",12            "output": "9 "13        },14        {15            "label": "Example 2",16            "input": "low = 1200, high = 1230",17            "output": "4 "18        }19    ],20    "private_test_cases": [],21    "haskell_template": "countSymmetricIntegers :: Int -> Int -> Int\ncountSymmetricIntegers low high ",22    "ocaml_template": "let countSymmetricIntegers (low: int) (high: int) : int =  ",23    "scala_template": "def countSymmetricIntegers(low: Int,high: Int): Int = { \n    \n}",24    "java_template": "public static int countSymmetricIntegers(int low, int high) {\n\n}",25    "python_template": "class Solution(object):\n    def countSymmetricIntegers(self, low, high):\n        \"\"\"\n        :type low: int\n        :type high: int\n        :rtype: int\n        \"\"\"\n        "26}