Largest Digit
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
Discussion (opens after you solve — no spoilers before)
Shafi
Dec 2, 2026 15:31 BDT
import sys
data = sys.stdin.read().strip().split()
if data:
n = data[0]
largest = max(ch for ch in n if "0" <= ch <= "9")
print(largest)