Previous Next
0 / 15
Module DEMO-33-67DEMO-OOP-33

Target Frequency Report

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read six integers and a target value, then print how many times the target appears.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. value 1
  2. value 2
  3. value 3
  4. value 4
  5. value 5
  6. value 6
  7. target value

Output Format

Print the exact report in this order:

  1. Frequency

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
1
2
1
3
1
4
1
Frequency: 3
Input: value 1 = 1, value 2 = 2, value 3 = 1, value 4 = 3, value 5 = 1, value 6 = 4, target value = 1.
Key calculation(s): values = {1, 2, 1, 3, 1, 4} | count = 0 | "Frequency: " + count = "Frequency: 3".
Output:
Frequency: 3
Sample #2
Public sample
5
5
5
5
5
5
5
Frequency: 6
Input: value 1 = 5, value 2 = 5, value 3 = 5, value 4 = 5, value 5 = 5, value 6 = 5, target value = 5.
Key calculation(s): values = {5, 5, 5, 5, 5, 5} | count = 0 | "Frequency: " + count = "Frequency: 6".
Output:
Frequency: 6

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings