FPEvalDataset/LeetCodeProblem
0305
1{2 "id": 3246,3 "name": "check_if_bitwise_or_has_trailing_zeros",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/check-if-bitwise-or-has-trailing-zeros/",6 "date": "2023-12-24 00:00:00",7 "task_description": "You are given an array of **positive** integers `nums`. You have to check if it is possible to select **two or more** elements in the array such that the bitwise `OR` of the selected elements has **at least **one trailing zero in its binary representation. For example, the binary representation of `5`, which is `\"101\"`, does not have any trailing zeros, whereas the binary representation of `4`, which is `\"100\"`, has two trailing zeros. Return `true` _if it is possible to select two or more elements whose bitwise_ `OR` _has trailing zeros, return_ `false` _otherwise_. **Example 1:** ``` **Input:** nums = [1,2,3,4,5] **Output:** true **Explanation:** If we select the elements 2 and 4, their bitwise OR is 6, which has the binary representation \"110\" with one trailing zero. ``` **Example 2:** ``` **Input:** nums = [2,4,8,16] **Output:** true **Explanation: **If we select the elements 2 and 4, their bitwise OR is 6, which has the binary representation \"110\" with one trailing zero. Other possible ways to select elements to have trailing zeroes in the binary representation of their bitwise OR are: (2, 8), (2, 16), (4, 8), (4, 16), (8, 16), (2, 4, 8), (2, 4, 16), (2, 8, 16), (4, 8, 16), and (2, 4, 8, 16). ``` **Example 3:** ``` **Input:** nums = [1,3,5,7,9] **Output:** false **Explanation:** There is no possible way to select two or more elements to have trailing zeros in the binary representation of their bitwise OR. ``` **Constraints:** `2 <= nums.length <= 100` `1 <= nums[i] <= 100`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [1,2,3,4,5]",12 "output": "true "13 },14 {15 "label": "Example 2",16 "input": "nums = [2,4,8,16]",17 "output": "true "18 },19 {20 "label": "Example 3",21 "input": "nums = [1,3,5,7,9]",22 "output": "false "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 38,29 96,30 54,31 93,32 34,33 65,34 95,35 25,36 63,37 49,38 32,39 96,40 5,41 46,42 95,43 16,44 53,45 25,46 1,47 84,48 18,49 3,50 91,51 20,52 63,53 11,54 71,55 63,56 63,57 2,58 98,59 6860 ],61 "output": true62 },63 {64 "input": [65 17,66 64,67 92,68 91,69 94,70 66,71 87,72 91,73 18,74 44,75 65,76 37,77 41,78 16,79 38,80 74,81 91,82 37,83 38,84 36,85 9,86 4,87 7,88 75,89 390 ],91 "output": true92 },93 {94 "input": [95 73,96 56,97 23,98 72,99 18,100 92,101 82,102 54,103 87,104 3,105 1,106 77,107 70,108 15,109 24,110 72,111 47,112 27,113 82,114 11,115 87,116 21,117 47,118 75,119 53,120 3,121 21,122 4,123 84,124 64,125 4,126 36,127 52,128 40,129 80,130 86,131 25,132 74,133 1,134 2,135 90,136 35,137 5,138 82,139 45,140 59,141 78,142 1,143 56,144 16,145 63,146 69,147 86,148 65,149 62,150 8,151 54,152 92,153 35154 ],155 "output": true156 },157 {158 "input": [159 26,160 41,161 28,162 25,163 23,164 11,165 71,166 31,167 38,168 23,169 58,170 87,171 51,172 80,173 73,174 53,175 69,176 94,177 65,178 73,179 92,180 96,181 82,182 89,183 33,184 51,185 68,186 16,187 73,188 92,189 7,190 13,191 25,192 35,193 42,194 34,195 3,196 45,197 84,198 73,199 47,200 60,201 83,202 16,203 94,204 85,205 90,206 19,207 58,208 32,209 29,210 2,211 19,212 90,213 80,214 60,215 21,216 64,217 21,218 50,219 27,220 8,221 71,222 59,223 19,224 55,225 13,226 31,227 92,228 36,229 90,230 44,231 29,232 88233 ],234 "output": true235 },236 {237 "input": [238 3,239 80,240 72,241 87,242 40,243 47,244 92,245 43,246 47,247 27,248 51,249 14,250 23251 ],252 "output": true253 }254 ],255 "haskell_template": "hasTrailingZeros :: [Int] -> Bool\nhasTrailingZeros nums ",256 "ocaml_template": "let hasTrailingZeros (nums: int list) : bool = ",257 "scala_template": "def hasTrailingZeros(nums: List[Int]): Boolean = { \n \n}",258 "java_template": "class Solution {\n public boolean hasTrailingZeros(int[] nums) {\n \n }\n}",259 "python_template": "class Solution(object):\n def hasTrailingZeros(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: bool\n \"\"\"\n "260}