Problem
Input format
The first line contains the natural number `n`. The following lines (separated by spaces or newlines) contain the `n` integers. - `1 <= n <= 100` - elements are integers with at most 4 digits, possibly with sign - the subprogram `maxAparitii` must be defined explicitly, with `mx` and `cnt` passed by reference
Output format
The program prints on a single line two numbers separated by a space: the maximum value in the array and its number of occurrences.
Example
6 3 1 4 1 5 9
9 1
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
6 3 1 4 1 5 9
9 1
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.