HackerRank (C++)


Time Conversion

Given a time in $12$-hour AM/PM format, convert it to military (24-hour) time.

Note:

Example

Function Description

Complete the timeConversion function in the editor below. It should return a new string representing the input time in 24 hour format.

timeConversion has the following parameter(s):

Returns

Input Format

A single string $s$ that represents a time in $12$-hour clock format (i.e.: $hh:mm:ssAM$ or $hh:mm:ssPM$).

Constraints

Sample Input

07:05:45PM

Sample Output

19:05:45

hackerrank.com/challenges/one-month-preparation-kit-time-conversion/