CT23747

The Opal Shared Marks

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Brewer found an old ledger of shelves in the shed attic at the mountain city of Highreach. The margin notes pose a precise question. 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 <= 942; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 781 816 -703678136 -668590600 -720575529 -844421747 -820623599 -250040500 -690282830 -277629030 -768321022 -477300726 -487422558 -147411852 -663843242 -332058794 -806557636 -334692532 -265142186 -59172875 -267159697 -15576416 -420162370 -278752174 -611788997 -423373577 -382911287 -617798298 -389381544 -778338712 -339610341 -692689365 -996492769 -115408369 -438467635 -698080531 -536057735 -347955437 -526793400 -515917028 -211815288 -277846036 -685636006 -58813190 -755496947 -966684372 -493138746 -473251650 -143258122 -391522350 -811560726 -936078545 -523093841 -393168544 -922242186 -717043527 -292458451 -767503834 -165120824 -760929968 -996600429 -192931671 -12103022 -775688966 -953591553 -78138028 -661351149 -736262995 -756040458 -238626431 -801268691 -41172390 -815242495 -629894620 -95906…
Output: 0

Example 2:

Input: 406 713 -907997699 -851238513 -750581766 -219808150 -767081125 -112898066 -17803328 -362613700 -282978936 -530711309 -652317258 -793507773 -2148070 -770212485 -77443043 -107378514 -981132916 -733624465 -75577747 -595176439 -635480980 -212662415 -40590803 -101200535 -354020749 -853007273 -815787244 -791183691 -116083626 -528055246 -389572499 -622195334 -697846835 -517556700 -286929154 -258399763 -850830354 -359416818 -615197688 -796275297 -220945634 -508081082 -730587747 -833627880 -727058818 -545574576 -771096399 -948199216 -268384649 -12042733 -259999777 -40595146 -629305396 -894189947 -757219023 -827978853 -968306591 -506226771 -756650175 -302682224 -844795526 -519214849 -650061366 -597644205 -138507958 -417591996 -627480063 -121665825 -70314561 -589912160 -843376366 -8956393 -999589041 …
Output: 0

Example 3:

Input: 270 207 -369341513 -666940204 -259748517 -511336864 -934182275 -371647402 -929687604 -69536595 -581898826 -509803802 -198228677 -534862854 -786184962 -648804442 -572592219 -164389230 -813556499 -281493486 -200537577 -220090050 -927890418 -821129063 -666896422 -126471917 -797626806 -122510861 -810278147 -773436388 -581910160 -769553606 -439647947 -617019191 -904879896 -691239815 -765048749 -873338567 -688937320 -732223882 -222344879 -438484997 -322270361 -280117244 -391874813 -511943571 -851629471 -649255019 -520070985 -828825488 -42905801 -481569762 -755760671 -557397526 -397035039 -71655052 -835245194 -830548308 -460651960 -255124304 -275473055 -775222960 -824562061 -101368798 -625621184 -969701541 -590453858 -742411921 -19490810 -535091918 -412905834 -337678048 -400444705 -282274766 -209…
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Opal Shared Marks - EASY Coding Problem | CodeTikki