Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
ution.java x
// you can also use imports, for example:
// import java.util.;
// you can write to stdout for debugging purposes, e.g.
// System.out.println("this is a debug message");
class Solution {
public String solution(int A, int B, int C, int D, int E, int F)
// write your code in Java SE 8
expand button
Transcribed Image Text:ution.java x // you can also use imports, for example: // import java.util.; // you can write to stdout for debugging purposes, e.g. // System.out.println("this is a debug message"); class Solution { public String solution(int A, int B, int C, int D, int E, int F) // write your code in Java SE 8
Given six digits, find the earliest valid time that can be displayed on a
digital clock (in 24-hour format) using those digits. For example, given
digits 1, 8, 3, 2, 6, 4 the earliest valid time is "12:36:48". Note that
"12:34:68" is not a valid time.
Write a function:
class Solution ( public String solution (int A, int B, int
C, int D, int E, int F): }
that, given six integers A, B, C, D, E and F, returns the earliest valid time
in "HH:MM: SS" string format, or "NOT POSSIBLE" if It is not possible
to display a valid time using all six integers.
For example, glven 1, 8, 3, 2, 6, 4 the function should return
"12:36:48".
Given 0, 0, 0, 0, 0, 0, the function should return "00:00:00".
Given 0, 0, 0, 7, 8, 9, the function should return "07:08:09".
Given 2, 4, 5, 9,5, 9, the function should return "NOT POSSIBLE".
Assume that:
• A, B, C, D, E and F are integers within the range [0..9].
In your solution, focus on correctness. The performance of your
solution will not be the focus of the assessment.
expand button
Transcribed Image Text:Given six digits, find the earliest valid time that can be displayed on a digital clock (in 24-hour format) using those digits. For example, given digits 1, 8, 3, 2, 6, 4 the earliest valid time is "12:36:48". Note that "12:34:68" is not a valid time. Write a function: class Solution ( public String solution (int A, int B, int C, int D, int E, int F): } that, given six integers A, B, C, D, E and F, returns the earliest valid time in "HH:MM: SS" string format, or "NOT POSSIBLE" if It is not possible to display a valid time using all six integers. For example, glven 1, 8, 3, 2, 6, 4 the function should return "12:36:48". Given 0, 0, 0, 0, 0, 0, the function should return "00:00:00". Given 0, 0, 0, 7, 8, 9, the function should return "07:08:09". Given 2, 4, 5, 9,5, 9, the function should return "NOT POSSIBLE". Assume that: • A, B, C, D, E and F are integers within the range [0..9]. In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY