Please enter your email address or userHandle.
Given a time in the format of hh:mm (12-hour format) 0 < HH < 12, 0 <= MM < 60. The task is to convert it into words.
Input: H = 6, M = 0
Output: six o' clock
Explanation: 6H:0M = six o' clock.
Input: N = 6, M = 10
Output: ten minutes past six
Explanation: 6H:10M = ten minutes past six.
You dont need to read input or print anything. Complete the function timeToWord() which takes H and M as input parameter and returns words converted from given time.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(k2)
0 < H < 12
0= < M < 60
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.