FPEvalDataset/LeetCodeProblem
0304
1{2 "id": 3206,3 "name": "find_common_elements_between_two_arrays",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/find-common-elements-between-two-arrays/",6 "date": "2023-11-25 00:00:00",7 "task_description": "You are given two integer arrays `nums1` and `nums2` of sizes `n` and `m`, respectively. Calculate the following values: `answer1` : the number of indices `i` such that `nums1[i]` exists in `nums2`. `answer2` : the number of indices `i` such that `nums2[i]` exists in `nums1`. Return `[answer1,answer2]`. **Example 1:** **Input:** nums1 = [2,3,2], nums2 = [1,2] **Output:** [2,1] **Explanation:** **Example 2:** **Input:** nums1 = [4,3,2,3,1], nums2 = [2,2,5,2,3,6] **Output:** [3,4] **Explanation:** The elements at indices 1, 2, and 3 in `nums1` exist in `nums2` as well. So `answer1` is 3. The elements at indices 0, 1, 3, and 4 in `nums2` exist in `nums1`. So `answer2` is 4. **Example 3:** **Input:** nums1 = [3,4,2,3], nums2 = [1,5] **Output:** [0,0] **Explanation:** No numbers are common between `nums1` and `nums2`, so answer is [0,0]. **Constraints:** `n == nums1.length` `m == nums2.length` `1 <= n, m <= 100` `1 <= nums1[i], nums2[i] <= 100`",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "nums1 = [2,3,2], nums2 = [1,2]",12 "output": "[2,1] "13 },14 {15 "label": "Example 2",16 "input": "nums1 = [4,3,2,3,1], nums2 = [2,2,5,2,3,6]",17 "output": "[3,4] "18 },19 {20 "label": "Example 3",21 "input": "nums1 = [3,4,2,3], nums2 = [1,5]",22 "output": "[0,0] "23 }24 ],25 "private_test_cases": [26 {27 "input": [28 [29 91,30 59,31 92,32 51,33 27,34 53,35 39,36 13,37 58,38 21,39 62,40 20,41 7,42 69,43 53,44 50,45 98,46 64,47 15,48 9249 ],50 [51 42,52 29,53 51,54 96,55 15,56 84,57 100,58 51,59 59,60 82,61 73,62 19,63 79,64 67,65 85,66 15,67 86,68 49,69 8,70 57,71 10,72 26,73 21,74 28,75 90,76 16,77 68,78 29,79 62,80 48,81 94,82 92,83 11,84 13,85 2,86 21,87 64,88 49,89 83,90 8991 ]92 ],93 "output": [94 9,95 1196 ]97 },98 {99 "input": [100 [101 58,102 81,103 71,104 63,105 71,106 71,107 81,108 67,109 69,110 45,111 61,112 71,113 61,114 18,115 69,116 17,117 45,118 98,119 63,120 6,121 20,122 81123 ],124 [125 65,126 21,127 90,128 96,129 29,130 43,131 54,132 27,133 11,134 36,135 48,136 86,137 33,138 9,139 69,140 22,141 69,142 13,143 97,144 79,145 69,146 82,147 50,148 68,149 86,150 58,151 36,152 29,153 71,154 88,155 53,156 54,157 60,158 81,159 65,160 63,161 43,162 20,163 28,164 52,165 29,166 17,167 22,168 21,169 25170 ]171 ],172 "output": [173 14,174 9175 ]176 },177 {178 "input": [179 [180 5,181 100,182 26,183 90,184 36,185 7,186 92,187 6,188 54,189 92,190 21,191 62,192 79,193 11,194 52,195 94,196 5,197 80,198 51,199 84,200 100,201 95,202 3,203 22,204 15,205 49,206 62,207 57,208 49,209 4,210 94,211 81,212 5,213 35,214 90,215 9,216 16,217 37,218 33,219 26,220 57,221 42,222 89,223 7,224 83,225 95,226 55,227 52,228 56,229 71,230 9,231 37,232 67,233 60,234 25,235 61,236 85,237 74,238 45,239 5,240 4,241 83,242 98,243 12,244 35,245 5,246 69,247 83,248 86,249 93,250 60,251 23,252 92,253 59,254 44,255 55,256 13,257 83,258 63,259 48,260 20,261 7,262 73,263 6,264 85,265 16,266 66,267 25,268 13,269 50,270 81,271 45,272 7,273 89,274 77,275 55276 ],277 [278 61,279 19,280 51,281 55,282 33283 ]284 ],285 "output": [286 6,287 4288 ]289 },290 {291 "input": [292 [293 51,294 13,295 21,296 96,297 94,298 65,299 90,300 30,301 47,302 98,303 46,304 11,305 81,306 34,307 16,308 40,309 85,310 86,311 26,312 2,313 75,314 100,315 54,316 20,317 10,318 6,319 82,320 42,321 70,322 3,323 18,324 65,325 89,326 18,327 94,328 56,329 20,330 94,331 52,332 95,333 15,334 1,335 100,336 93,337 28,338 75,339 51,340 91,341 51,342 42,343 16,344 89,345 56,346 61347 ],348 [349 81,350 47,351 38,352 46,353 40,354 68,355 62,356 30,357 20,358 67,359 7,360 41,361 9,362 23,363 24,364 44,365 72,366 49,367 9,368 67,369 58,370 49,371 94,372 80,373 61,374 72,375 60,376 58,377 10,378 69,379 34,380 95,381 75,382 95,383 88,384 10,385 8,386 86,387 42,388 19,389 10,390 64391 ]392 ],393 "output": [394 19,395 17396 ]397 },398 {399 "input": [400 [401 71,402 85,403 74,404 7,405 59,406 90,407 6,408 70,409 1,410 68,411 51,412 41,413 94,414 10415 ],416 [417 20,418 98,419 40,420 2,421 51,422 70,423 31,424 78,425 23,426 48,427 80,428 9,429 34,430 79,431 21,432 60,433 4,434 79,435 62,436 63,437 42,438 39,439 43,440 42,441 84,442 4,443 66,444 64,445 52,446 73,447 20,448 68,449 29,450 21,451 53,452 4,453 50,454 35,455 73,456 40,457 52,458 28,459 59,460 28,461 21,462 4,463 69,464 18,465 80,466 14,467 20,468 59,469 48,470 70,471 64,472 24,473 21,474 17,475 92,476 55,477 59,478 96,479 87,480 73,481 8,482 6,483 48,484 8,485 59,486 62,487 91488 ]489 ],490 "output": [491 5,492 9493 ]494 },495 {496 "input": [497 [498 76,499 24,500 36,501 35,502 55,503 19,504 93,505 71,506 4,507 53,508 21,509 7,510 42,511 87,512 12,513 2,514 86,515 9,516 69,517 85,518 35,519 41,520 41,521 81,522 3,523 58,524 65,525 45,526 95,527 85,528 50,529 18,530 55,531 49,532 43,533 17,534 19,535 94,536 83,537 53,538 70,539 53,540 39541 ],542 [543 34,544 89,545 33,546 81,547 37,548 60,549 49,550 47,551 9,552 95,553 68,554 54,555 79,556 25,557 9,558 90,559 13,560 60,561 97,562 98,563 18,564 2,565 64,566 80,567 17,568 56,569 75,570 56,571 29,572 98,573 63,574 74,575 67,576 91,577 75,578 73,579 73,580 73,581 48,582 6,583 79,584 16,585 21,586 8,587 97,588 73,589 32,590 1,591 72,592 98,593 46,594 77,595 65,596 42,597 30,598 94,599 61,600 5,601 52,602 43,603 15,604 46,605 3606 ]607 ],608 "output": [609 13,610 14611 ]612 },613 {614 "input": [615 [616 85,617 98,618 35,619 94,620 33,621 58,622 69,623 4,624 62,625 15,626 50,627 32,628 99,629 42,630 96,631 68,632 54,633 7,634 96,635 64,636 95,637 9,638 44,639 11,640 79,641 87,642 63,643 61,644 28,645 91,646 11,647 91,648 16,649 60,650 33,651 70,652 50,653 53,654 91,655 99,656 90,657 88,658 22,659 88,660 53,661 22662 ],663 [664 65,665 61,666 97,667 42,668 4,669 12,670 21,671 21,672 21,673 92674 ]675 ],676 "output": [677 3,678 3679 ]680 }681 ],682 "haskell_template": "findIntersectionValues :: [Int] -> [Int] -> [Int]\nfindIntersectionValues nums1 nums2 ",683 "ocaml_template": "let findIntersectionValues (nums1: int list) (nums2: int list) : int list = ",684 "scala_template": "def findIntersectionValues(nums1: List[Int],nums2: List[Int]): List[Int] = { \n \n}",685 "java_template": "class Solution {\n public int[] findIntersectionValues(int[] nums1, int[] nums2) {\n \n }\n}",686 "python_template": "class Solution(object):\n def findIntersectionValues(self, nums1, nums2):\n \"\"\"\n :type nums1: List[int]\n :type nums2: List[int]\n :rtype: List[int]\n \"\"\"\n "687}