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"); ass Solution { public String solution(int

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
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
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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY