Team Ai
Datasetpublic

FPEvalRepoPublic/LeetCodeMetaData

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes399downloads
minimum-impossible-or.json29 linesDownload Raw Back to root
1{2  "id": 2705,3  "name": "minimum-impossible-or",4  "difficulty": "Medium",5  "link": "https://leetcode.com/problems/minimum-impossible-or/",6  "date": "2023-02-04",7  "task_description": "You are given a **0-indexed** integer array `nums`. We say that an integer x is **expressible** from `nums` if there exist some integers `0 <= index1 < index2 < ... < indexk < nums.length` for which `nums[index1] | nums[index2] | ... | nums[indexk] = x`. In other words, an integer is expressible if it can be written as the bitwise OR of some subsequence of `nums`. Return _the minimum **positive non-zero integer** that is not __expressible from _`nums`. **Example 1:** ``` **Input:** nums = [2,1] **Output:** 4 **Explanation:** 1 and 2 are already present in the array. We know that 3 is expressible, since nums[0] | nums[1] = 2 | 1 = 3. Since 4 is not expressible, we return 4. ``` **Example 2:** ``` **Input:** nums = [5,3,2] **Output:** 1 **Explanation:** We can show that 1 is the smallest number that is not expressible. ``` **Constraints:** `1 <= nums.length <= 105` `1 <= nums[i] <= 109`",8  "test_case": [9    {10      "label": "Example 1",11      "input": "nums = [2,1]",12      "output": "4 "13    },14    {15      "label": "Example 2",16      "input": "nums = [5,3,2]",17      "output": "1 "18    }19  ],20  "constraints": [21    "1 <= nums.length <= 105",22    "1 <= nums[i] <= 109"23  ],24  "python_template": "class Solution(object):\n    def minImpossibleOR(self, nums):\n        \"\"\"\n        :type nums: List[int]\n        :rtype: int\n        \"\"\"\n        ",25  "java_template": "class Solution {\n    public int minImpossibleOR(int[] nums) {\n        \n    }\n}",26  "metadata": {27    "func_name": "minImpossibleOR"28  }29}