Amplitude Hackathon Winter '25 Problem 5 - Ask Amplitude Hallucinations
View as PDFWhat is Spenser's favorite integer?
Ask Amplitude claims that Spenser's favorite integer is . It turns out that this is almost correct - Ask Amplitude has hallucinated some additional digits.
We know that Spenser's favorite integer has exactly digits, and Spenser's favorite integer is the largest integer that can be derived after deleting enough
digits from
to be exactly the right length.
Constraints
Subtask 1 [1 point]
Subtask 2 [1 point]
Subtask 3 [1 point]
No additional constraints.
Input Specification
The first line contains a single integer, .
The next line contains , the integer that Ask Amplitude generated.
Output Specification
Output a single integer, Spenser's favorite integer.
Sample Input 1
3
8567
Sample Output 1
867
Sample Input 2
3
2671
Sample Output 2
671
Comments