CT22948

The Wayward Shared Marks

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Zaid runs the counting house at the desert outpost of Sandspire. Today the books show a list of weights, and the numbers must be worked out before sundown. 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 <= 574; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 556 66 -74939515 -332772601 -610482730 -104305552 -388917195 -375888752 -726708625 -634866094 -165511558 -159942622 -78228234 -965932629 -423262192 -219760675 -53714037 -574255029 -32366997 -440038666 -546944993 -450315367 -916839021 -84007631 -511064842 -989469822 -609627447 -304340707 -67529856 -210728704 -234023404 -681070768 -920215123 -139872464 -673091329 -405370743 -124556964 -816855014 -818907913 -881418589 -786946772 -545977049 -791261813 -272557885 -109768076 -853574788 -477288420 -704857586 -890254650 -817336911 -154810898 -683332047 -116758916 -958509187 -3518224 -34431767 -997348336 -673564212 -723637179 -775140090 -1712446 -510995903 -828048392 -335777099 -507522274 -815282513 -455877913 -820261056 -501951081 -801533036 -526209011 -11749596 -486710032 -18392492 -257489314 -46…
Output: 0

Example 2:

Input: 38 261 -839017126 -579935000 -605032411 -908399448 -978529685 -724125864 -938329968 -30813608 -201447944 -846925446 -763998835 -910978531 -684167493 -445704540 -211064181 -295165124 -959621117 -812948457 -104271166 -621283421 -475366552 -304856144 -197967727 -887586661 -108875937 -242017814 -541527423 -654538094 -249282686 -234018857 -547892105 -667903829 -52942532 -49496529 -382300120 -641683527 -50302730 -955758892 -25226908 -191422457 -776494421 -428372075 -364517279 -455228568 -305940409 -841677214 -450789119 -649309700 -994730721 -674335771 -167144329 -162794521 -277557613 -994987260 -762845072 -757862493 -281132036 -892238629 -313783703 -818813104 -977473577 -129636075 -840607185 -72052166 -262514410 -895703880 -16831324 -372990518 -129926463 -193306996 -359116884 -760760803 -3057534…
Output: 0

Example 3:

Input: 262 46 -801202636 -835834588 -859247662 -476570388 -417312165 -120006384 -186712499 -452771265 -523487881 -297985871 -228457894 -461898695 -278533999 -451798848 -979509754 -862886296 -150460386 -681516777 -28674768 -965559834 -943959971 -489636950 -394880318 -641656591 -198000566 -70345989 -408871742 -470542576 -695544203 -533409391 -826971280 -803795374 -15295359 -202099520 -428386547 -306123050 -505288205 -991400712 -379512765 -749122864 -621777679 -826469817 -760894883 -125552012 -259992856 -856946944 -254281256 -821709908 -155113246 -698336342 -203275666 -589405010 -322857049 -719935381 -654863677 -806710357 -813181182 -581643538 -493865281 -655605448 -296994841 -121370 -552002824 -642838988 -44613991 -792013290 -83072300 -791087944 -959924479 -984237386 -750926084 -754353609 -98753816…
Output: 0

Constraints:

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

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