FPEvalDataset/LeetCodeProblem
0305
1{2 "id": 3381,3 "name": "shortest_subarray_with_or_at_least_k_i",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-i/",6 "date": "2024-03-16 00:00:00",7 "task_description": "You are given an array `nums` of **non-negative** integers and an integer `k`. An array is called **special** if the bitwise `OR` of all of its elements is **at least** `k`. Return _the length of the **shortest** **special** **non-empty** subarray of_ `nums`, _or return_ `-1` _if no special subarray exists_. **Example 1:** **Input:** nums = [1,2,3], k = 2 **Output:** 1 **Explanation:** The subarray `[3]` has `OR` value of `3`. Hence, we return `1`. Note that `[2]` is also a special subarray. **Example 2:** **Input:** nums = [2,1,8], k = 10 **Output:** 3 **Explanation:** The subarray `[2,1,8]` has `OR` value of `11`. Hence, we return `3`. **Example 3:** **Input:** nums = [1,2], k = 0 **Output:** 1 **Explanation:** The subarray `[1]` has `OR` value of `1`. Hence, we return `1`. **Constraints:** `1 <= nums.length <= 50` `0 <= nums[i] <= 50` `0 <= k < 64`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums = [1,2,3], k = 2",12 "output": "1 "13 },14 {15 "label": "Example 2",16 "input": "nums = [2,1,8], k = 10",17 "output": "3 "18 },19 {20 "label": "Example 3",21 "input": "nums = [1,2], k = 0",22 "output": "1 "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 [29 22,30 31,31 32,32 30,33 43,34 26,35 31,36 22,37 18,38 22,39 35,40 8,41 24,42 1243 ],44 4745 ],46 "output": 247 },48 {49 "input": [50 [51 4,52 39,53 7,54 38,55 9,56 15,57 31,58 20,59 4,60 2,61 36,62 41,63 27,64 38,65 4266 ],67 6068 ],69 "output": 270 },71 {72 "input": [73 [74 1,75 21,76 41,77 7,78 42,79 24,80 16,81 22,82 16,83 1,84 8,85 3,86 8,87 32,88 21,89 11,90 4,91 22,92 35,93 27,94 2495 ],96 3397 ],98 "output": 199 },100 {101 "input": [102 [103 15,104 40,105 37,106 16,107 33,108 6,109 49,110 25,111 32,112 48,113 34,114 23,115 9,116 46,117 9,118 45,119 32,120 34,121 42,122 16,123 14,124 3,125 50,126 5,127 22,128 17,129 50130 ],131 44132 ],133 "output": 1134 },135 {136 "input": [137 [138 8,139 30,140 41,141 14,142 5,143 17,144 17,145 4,146 46,147 0,148 48,149 22,150 44,151 26,152 48,153 10,154 22,155 44,156 14,157 29,158 9,159 30160 ],161 13162 ],163 "output": 1164 },165 {166 "input": [167 [168 19,169 45,170 49,171 7,172 49,173 42,174 44,175 14,176 23,177 11,178 49,179 35,180 43,181 22,182 29,183 48,184 42,185 19,186 17,187 26,188 24,189 42,190 43,191 16,192 30,193 44,194 18,195 25,196 32,197 12,198 12,199 18,200 19,201 15,202 9,203 4204 ],205 55206 ],207 "output": 2208 },209 {210 "input": [211 [212 40,213 17,214 33,215 21,216 29,217 36,218 7,219 6,220 22,221 42,222 31223 ],224 46225 ],226 "output": 2227 },228 {229 "input": [230 [231 2,232 31,233 49,234 26,235 46,236 15,237 16,238 46,239 7,240 27,241 32,242 2,243 48,244 45,245 9,246 46,247 30,248 10,249 18250 ],251 55252 ],253 "output": 2254 },255 {256 "input": [257 [258 33,259 43,260 49,261 18,262 21,263 40264 ],265 49266 ],267 "output": 1268 },269 {270 "input": [271 [272 1,273 12,274 9,275 0,276 21,277 29,278 21,279 4,280 2,281 15,282 16,283 2,284 15,285 13,286 49,287 17,288 18,289 32,290 50,291 49,292 26,293 28,294 10,295 20,296 12297 ],298 20299 ],300 "output": 1301 }302 ],303 "haskell_template": "minimumSubarrayLength :: [Int] -> Int -> Int\nminimumSubarrayLength nums k ",304 "ocaml_template": "let minimumSubarrayLength (nums: int list) (k: int) : int = ",305 "scala_template": "def minimumSubarrayLength(nums: List[Int],k: Int): Int = { \n \n}",306 "java_template": "class Solution {\n public int minimumSubarrayLength(int[] nums, int k) {\n \n }\n}",307 "python_template": "class Solution(object):\n def minimumSubarrayLength(self, nums, k):\n \"\"\"\n :type nums: List[int]\n :type k: int\n :rtype: int\n \"\"\"\n "308}