Team Ai
Datasetpublic

FPEvalRepoPublic/LeetCodeMetaData

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes402downloads
minimum-array-end.json28 linesDownload Raw Back to root
1{2  "id": 3394,3  "name": "minimum-array-end",4  "difficulty": "Medium",5  "link": "https://leetcode.com/problems/minimum-array-end/",6  "date": "2024-04-21",7  "task_description": "You are given two integers `n` and `x`. You have to construct an array of **positive** integers `nums` of size `n` where for every `0 <= i < n - 1`, `nums[i + 1]` is **greater than** `nums[i]`, and the result of the bitwise `AND` operation between all elements of `nums` is `x`. Return the **minimum** possible value of `nums[n - 1]`. **Example 1:** **Input:** n = 3, x = 4 **Output:** 6 **Explanation:** `nums` can be `[4,5,6]` and its last element is 6. **Example 2:** **Input:** n = 2, x = 7 **Output:** 15 **Explanation:** `nums` can be `[7,15]` and its last element is 15. **Constraints:** `1 <= n, x <= 108`",8  "test_case": [9    {10      "label": "Example 1",11      "input": "n = 3, x = 4",12      "output": "6 "13    },14    {15      "label": "Example 2",16      "input": "n = 2, x = 7",17      "output": "15 "18    }19  ],20  "constraints": [21    "1 <= n, x <= 108"22  ],23  "python_template": "class Solution(object):\n    def minEnd(self, n, x):\n        \"\"\"\n        :type n: int\n        :type x: int\n        :rtype: int\n        \"\"\"\n        ",24  "java_template": "class Solution {\n    public long minEnd(int n, int x) {\n        \n    }\n}",25  "metadata": {26    "func_name": "minEnd"27  }28}