Prime number
Practice
0 (0 votes)
Open
Open
Medium
Math basic
Basic math
Mathematics
Open
Math
Problem
30% Success 136 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given a large integer value \(n\). de the largest number \(x\) such that \(x \le n\) and all digits of \(x\) are prime.
Input format
Only line of input consists of a single integer denoting \(n\)
Output format
Print the required answer.
Constraints
\(1 \le Number \; of \; digits \; in \; n \le 10^{5} \)
No leading zeroes are available in \(n\)
\(n \ge 2\)
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
31 votes
Tags:
ApprovedEasy-Medium
Points:20
19 votes
Tags:
ApprovedBasic ProgrammingBasics of ImplementationEasyGrammar-VerifiedImplementationReadyRecruitSimulation
Points:20
6 votes
Tags:
MathematicsOpenApprovedEasy
Editorial
Login to unlock the editorial