Problems > Largest Digit

Largest Digit

Difficulty: 800 2000 ms 128 MB

implementation

Print the largest decimal digit that appears in N.

Input: one integer N.

Output: the largest digit of N.

Constraints:

  • 0 ≤ N ≤ 1018

Sample Tests

Input 1
2739
Output 1
9
Input 2
444
Output 2
4

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.