PROBLEM LINKS:
Author:
Tester and Editorialist:
DIFFICULTY:
EASY
PREREQUISITES:
12 hr to 24 hr clock time conversion
PROBLEM:
Given a time in 12hr format print the same time in 24hr format.
EXPLANATION:
For a given time in 12hr format we check if it is in AM or PM.
If it is in PM and the hour is less and 12 then we add 12 to it, but if the hour is equal to 12 then we keep it as it is.
If it is in AM and the hour is equal to 12 then we make the hour as 0 and do nothing otherwise.
TESTER’S SOLUTION:
Can be found here