CT1184

The Occurrence Count of Sunspire

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Aria runs the stall at the temple city of Sunspire. Today the books show a list of tickets, and the numbers must be worked out before sundown. 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 <= 98; -100 <= a[i],x <= 1000.

Example 1:

Input: 74 328 662 233 328 404 874 651 734 550 312 507 195 57 526 957 881 60 982 624 130 350 555 924 -31 741 518 315 -98 405 886 273 319 728 39 199 670 317 996 901 665 -23 753 863 91 763 25 16 421 730 434 466 392 -10 295 766 222 564 274 949 117 96 737 744 -40 154 991 926 645 857 319 461 924 93 691 306
Output: 1

Example 2:

Input: 89 330 438 515 502 691 772 682 774 92 331 175 667 265 778 591 692 856 335 232 807 307 485 412 380 839 508 701 390 866 -84 512 263 975 981 64 739 822 784 711 441 962 107 358 483 208 47 76 528 372 417 693 786 997 523 -25 948 135 578 445 697 405 732 -27 299 700 644 882 277 442 633 73 397 638 935 94 355 123 48 807 926 416 218 259 345 455 621 520 99 680 85
Output: 0

Example 3:

Input: 73 215 476 346 486 -28 904 98 186 479 440 980 122 566 765 451 956 759 916 308 614 959 493 734 492 680 -37 55 74 913 973 247 780 652 794 361 584 -88 974 630 160 717 128 303 311 666 42 299 317 516 644 804 227 789 583 877 435 232 126 554 245 387 449 606 209 549 33 962 596 529 952 214 974 388 574
Output: 0

Constraints:

1 <= n <= 98; -100 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
The Occurrence Count of Sunspire - EASY Coding Problem | CodeTikki