FPEvalDataset/LeetCodeProblem
0305
1{2 "id": 2507,3 "name": "number_of_common_factors",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/number-of-common-factors/",6 "date": "1664064000000",7 "task_description": "Given two positive integers `a` and `b`, return _the number of **common** factors of _`a`_ and _`b`. An integer `x` is a **common factor** of `a` and `b` if `x` divides both `a` and `b`. **Example 1:** ``` **Input:** a = 12, b = 6 **Output:** 4 **Explanation:** The common factors of 12 and 6 are 1, 2, 3, 6. ``` **Example 2:** ``` **Input:** a = 25, b = 30 **Output:** 2 **Explanation:** The common factors of 25 and 30 are 1, 5. ``` **Constraints:** `1 <= a, b <= 1000`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "a = 12, b = 6",12 "output": "4 "13 },14 {15 "label": "Example 2",16 "input": "a = 25, b = 30",17 "output": "2 "18 }19 ],20 "private_test_cases": [21 {22 "input": [23 451,24 14725 ],26 "output": 127 },28 {29 "input": [30 140,31 72532 ],33 "output": 234 },35 {36 "input": [37 640,38 8139 ],40 "output": 141 },42 {43 "input": [44 868,45 55946 ],47 "output": 148 },49 {50 "input": [51 195,52 38453 ],54 "output": 255 },56 {57 "input": [58 739,59 21560 ],61 "output": 162 },63 {64 "input": [65 103,66 42267 ],68 "output": 169 },70 {71 "input": [72 705,73 2374 ],75 "output": 176 },77 {78 "input": [79 1000,80 48881 ],82 "output": 483 },84 {85 "input": [86 202,87 86288 ],89 "output": 290 }91 ],92 "haskell_template": "commonFactors :: Int -> Int -> Int\ncommonFactors a b ",93 "ocaml_template": "let commonFactors (a: int) (b: int) : int = ",94 "scala_template": "def commonFactors(a: Int,b: Int): Int = { \n \n}",95 "java_template": "public static int commonFactors(int a, int b) {\n\n}",96 "python_template": "class Solution(object):\n def commonFactors(self, a, b):\n \"\"\"\n :type a: int\n :type b: int\n :rtype: int\n \"\"\"\n "97}