## A Simple Mode

View as PDF

Points:8 (partial)
Time limit:0.2s
Memory limit:1M
Author:

Problem type

Allowed languages
Assembly

Write a program to find the mode of a list of 8-bit integers.

Since you think this is too easy a task for your programming prowess, you've decided to make life more interesting... by computing this simple mode in assembly. You're guaranteed by your teacher that the mode will be unique.

#### Input Specification

The first line of input will contain the integer .
The second line of input will contain space-separated 8-bit integers in the range , representing the list.

#### Output Specification

The mode of the list.

#### Sample Input

5
2 2 9 0 18


#### Sample Output

2


#### Note

To use libc in NASM, the first line of your program should be ; libc. For all others, it should be ; features: libc.

#### Language Constraints

Because Assembly (ARM) runs under qemu, it is allocated 0.5s and 4096kb of RAM.