AmazonOA #182
Find Encrypted Number
Estimated EasyJudge-ready
Topics (AI-labelled)SimulationBits & Math
Repeatedly form the next row from the last digits of the sums of adjacent digits until only 2 digits remain, then output them as a two-character string, keeping leading 0s.
Input
The first line contains n; the second line contains n digits. 2≤n≤5000, each in 0..9.
Output
Output exactly two digit characters; leading 0s must be kept.
Example 1
Input:
4
4 5 6 7
Output:
04
Example 2
Input:
2
0 4
Output:
04
Example 3
Input:
3
9 9 9
Output:
88
Example notes
The answers are 04, 04 and 88; the third example has only one round, and the last digit of 9+9 is 8 in both positions.
Editorial
Loading solution…