Team Ai
Datasetpublic

FPEvalRepoPublic/LeetCodeMetaData

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes399downloads
maximum-prime-difference.json30 linesDownload Raw Back to root
1{2  "id": 3373,3  "name": "maximum-prime-difference",4  "difficulty": "Medium",5  "link": "https://leetcode.com/problems/maximum-prime-difference/",6  "date": "2024-04-07",7  "task_description": "You are given an integer array `nums`. Return an integer that is the **maximum** distance between the **indices** of two (not necessarily different) prime numbers in `nums`_._ **Example 1:** **Input:** nums = [4,2,9,5,3] **Output:** 3 **Explanation:** `nums[1]`, `nums[3]`, and `nums[4]` are prime. So the answer is `|4 - 1| = 3`. **Example 2:** **Input:** nums = [4,8,2,8] **Output:** 0 **Explanation:** `nums[2]` is prime. Because there is just one prime number, the answer is `|2 - 2| = 0`. **Constraints:** `1 <= nums.length <= 3 * 105` `1 <= nums[i] <= 100` The input is generated such that the number of prime numbers in the `nums` is at least one.",8  "test_case": [9    {10      "label": "Example 1",11      "input": "nums = [4,2,9,5,3]",12      "output": "3 "13    },14    {15      "label": "Example 2",16      "input": "nums = [4,8,2,8]",17      "output": "0 "18    }19  ],20  "constraints": [21    "1 <= nums.length <= 3 * 105",22    "1 <= nums[i] <= 100",23    "The input is generated such that the number of prime numbers in the nums is at least one."24  ],25  "python_template": "class Solution(object):\n    def maximumPrimeDifference(self, nums):\n        \"\"\"\n        :type nums: List[int]\n        :rtype: int\n        \"\"\"\n        ",26  "java_template": "class Solution {\n    public int maximumPrimeDifference(int[] nums) {\n        \n    }\n}",27  "metadata": {28    "func_name": "maximumPrimeDifference"29  }30}