CT23734

Nila Counts the scrolls

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Nila found an old ledger of scrolls in the mill attic at the old quarter of Brasshaven. The margin notes pose a precise question. Task: Read n integers and a target x; print how many times x occurs. Input format: First line: n and x. Second line: n space-separated integers. Output format: Print the number of occurrences of x. Constraints: 1 <= n <= 223; -100 <= a[i],x <= 1000000000.

Example 1:

Input: 133 79411870 44255563 761986207 667854292 355279596 446215719 234053202 66146666 152800017 271115250 350939384 701282425 799971034 221533211 421560487 744836521 205889570 555924371 797419952 365946634 529092600 489672158 640439547 209612246 111508253 516208147 448848490 262991833 639010336 510058658 828244800 345116370 661183649 292882440 923758623 873515852 17376954 902112980 410177240 382942346 816411318 294659380 899660885 855400664 8965327 347765111 65165345 901853865 616087006 6711347 277305048 265312986 325353393 795581504 224290510 91988642 463858085 781611282 74659753 154968160 423155768 435946460 391396744 153675377 360614823 719834674 893550585 850882687 36647590 753434882 377881006 873606403 389488709 50808595 811257905 254663406 70317446 827365417 340544640 797539328 660599329 …
Output: 0

Example 2:

Input: 37 733846023 921598598 787159888 320108993 652153579 182242203 377810464 990138262 647287967 733717705 711363319 38221817 774718976 461193226 706890542 884810903 176183236 194582923 287978957 882776538 460263143 377516013 39703936 775850285 782922929 209122279 642746906 571161890 352423235 911983298 94936899 707420568 410900763 17366965 513435047 84700207 141016425 520599188
Output: 0

Example 3:

Input: 9 321314900 769713755 322135015 171314844 736857208 530335150 935985153 729938603 503175030 101076174
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Nila Counts the scrolls - EASY Coding Problem | CodeTikki