Problems > Digit Duel

Digit Duel

Difficulty: 1100 2000 ms 128 MB

implementation

Align A and B by their LAST digits (pad the shorter with leading zeros); build the number taking the larger digit at each position. Print it without leading zeros.

Input: one line with two integers A and B.

Output: the digit-wise maximum.

Constraints:

  • 0 ≤ A, B ≤ 1018

Sample Tests

Input 1
523 68
Output 1
568
Input 2
7 7
Output 2
7

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.