TopCoder problem "Hands" used in SRM 14 (Division I Level One , Division II Level One)

Problem Statement

Class name: Hands
Method name: overlap
Parameters: int
Returns: String

Implement a class Hands, which contains a method overlap.  The method takes an
int representing an hour and returns a String representing the closest time
(hour, minutes, and seconds) after or including the start of that hour that the
hour and minute hands overlap.

The time should be returned as a String, in the format hh:mm:ss, where hh is
the hour (from 01 to 12), mm is the minute (from 00 to 59), and ss is the
number of seconds (from 00 to 59).  The fractional seconds in the result should
be discarded (i.e., round down or truncate).

The method signature is:
public String overlap(int hour);

hour is between 1 and 12, inclusive.

- If hour is 12, the hands are already overlapping at "12:00:00"
- If hour is 3, the hands will overlap at "03:16:21"
- If hour is 9, the hands will overlap at "09:49:05"


Method signature:String overlap(int param0)
(be sure your method is public)

Problem url:

Problem stats url:




Problem categories: