Lucky Time
Practice
4.7 (6 votes)
Implementation
Data structures
Ad Hoc
Easy
Open
Approved
Problem
50% Success 2038 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code
Alice is a geeky girl. She has a lot of codes to execute but she always choose a lucky time to execute a code.
- Time is shown in \(24\) hour format as hh:mm:ss
- Time is said to be lucky if all the 6 characters (except ':') are different.
Given the time when she completed the code find a lucky time to execute it so that Alice need to wait as little as possible.
Input :
First line contains T, the number of test cases. Each of next T lines contains time when she completes a code (in format described above).
Output:
For each test case, output a single line containing lucky time (in format described above)
Constraints :
\(0 \le hh < 24\)
\(0 \le mm < 60\)
\(0 \le ss < 60\)
Code Editor
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
7 votes
Tags:
AlgorithmsMedium
Points:20
102 votes
Tags:
Ad-HocReadyHiringData StructuresEasy
Points:30
38 votes
Tags:
Dynamic ProgrammingApprovedMediumMatrix Exponentiation
Editorial
Login to unlock the editorial
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