Practice

Guessing Attempts Counter

EASYLoops4 marks

Read a secret integer, then keep reading guesses until the secret is guessed. Output the number of guesses made.

Input: The secret number followed by one or more guesses. Output: The number of attempts.

Example:

Input:  12
        5
        10
        12
Output: 3
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Three attempts
Inputs: 12, 5, 10, 12
Expected: 3
Test 2: Correct first guess
Inputs: 8, 8
Expected: 1