CT27585

Marek's Sable shelves

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Marek inherited the exchange at the lakeside town of Mirrormere along with its curious bookkeeping system for shelves. Time to make sense of it. Task: Print the number of distinct values that appear in both arrays. Input format: First line: n and m. Second line: n integers. Third line: m integers. Output format: Print the size of the intersection. Constraints: 1 <= n <= 834; -1000000000 <= a[i],x <= 1000000000.

Example 1:

Input: 663 677 -449184119 -614930387 406412777 663087154 -35464787 699226387 -980230895 666778012 -417879547 847437860 -500116935 -390867335 28986242 44944364 629588989 -262717195 310469641 273754476 -617764447 -708001862 338543955 240770264 488577969 165882040 38750745 -302113662 -256823105 -285202370 979814437 430429980 -389357440 219704253 802295069 -770305538 649651747 -405630229 500743071 142252505 -401258603 201969769 -220958804 839487091 581166612 -69300643 -441358498 -548318087 834033999 547977101 -932757331 251292875 -547206250 -376366987 -516051370 879357226 208843971 105486846 -860357474 -747268093 -49273953 -133200877 -277697951 75643070 984726033 109548430 845227221 -687511706 -677431421 391554487 780311940 336932853 870472024 504935739 688075604 327968356 425445815 546786707 -475275…
Output: 0

Example 2:

Input: 740 808 92018317 -447523601 625947273 -819340219 -559399229 -3353436 629233711 442361851 -448026674 -906303185 -369604755 140163434 -885433405 -269063386 672755270 415583054 931635064 974512652 -606809986 252184138 24092930 959565096 265590324 660789024 866429138 -455541041 -942985803 -556583517 -235190076 663250556 -264801589 727005033 805132728 779614801 327067363 184086658 -991484061 436679884 -23557669 -866474171 -203911887 507275053 22763679 -80163416 -238207347 294237401 320115738 994287661 -153166326 -466290408 885809660 49965557 356353505 366860722 938672682 -795117292 -813033077 -858165810 544748990 962334035 552102338 528436496 519269545 -881576225 -144055179 516464047 -776108644 973018840 -751147751 607633297 645397404 197642038 -340693935 -888149787 -376217758 597628095 -968036…
Output: 0

Example 3:

Input: 318 361 -887482501 -350282834 -727087361 266968932 631692727 -630165967 317242577 -915071517 55180181 -57564511 231285399 -174287129 -893159442 677769681 245242786 874690410 -488566384 126199877 -195904346 553639855 -87100405 399381895 -189775380 -434120494 28882563 -751634574 -487363322 -417894924 803404378 -565945170 -352974759 -541142327 -664884 -848119855 922929776 -466856191 736786312 667035262 633922176 366386732 -465467179 318574730 295637108 -49944156 694194047 742278117 -267805475 972490432 46801896 -483767420 101444942 508917991 -673389265 -361359121 -443552168 -376970396 -910278261 966505683 -474296860 -562260483 637232722 738154908 193203651 -83075886 -635654256 282126559 -502912857 -909341481 -525218706 722163564 -954028006 619731008 779650244 -234894395 -991946828 904835466 3…
Output: 0

Constraints:

1 <= n <= 834; -1000000000 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Marek's Sable shelves - EASY Coding Problem | CodeTikki