← November 2025 questions

NOVEMBER 2025 / INTERMEDIATE / QUESTION 6

Robot Communication Zones

Archived question

Try the question in your own editor, then check your output below.

THE QUESTION

Text from the official booklet. Refer to the PDF for original mathematical notation, formatting, and linked input files. Printed samples and inputs are reproduced as published.

During a robot invasion, signals are recorded as uppercase letters. Divide them into
equal segments (zones) and find which robot wins most zones (frequency-based).
Input:
Two integers p, n, followed by string s
Sample Input:
9 3
AABBCCBAA
Sample Output:
A
Question Input:
24 6
ABBCCDAABBBCCCDDDEEEFFF

PRACTICE CHECK

Try your answer.

The final input declares 24 characters but supplies 23. The checker uses the complete sample, not a guessed missing character.

Run your program in your own editor, then paste its output below. This checks the stated output or checkpoint; it does not assess your full program. Practice attempts do not affect competition scores.

Check the complete published sample instead: p=9, n=3, s=AABBCCBAA. Break any tie alphabetically.

Reveal worked answer

Your output

A

The three groups are AAB, BCC and BAA; their winners are A, C and A.

Source: Girls in Code SEA 2025 Fall Competition, 29 November 2025. Booklet created by Emily Xu and the GIC question authors. Shared for non-commercial educational use with attribution, as permitted in the booklet.