HackerRank ‘The Time In Words’ Solution

Short Problem Definition:

Given the time in numerals we may convert it into words.


The Time In Words


time complexity is O(?)

space complexity is O(?)


I might have hinted at my opinion in the past: Why do “challenges” like this even exist? It requires 0 brain power, but you will spend an hour figuring out the fine details of English and fixing bugs.


import math
import os
import random
import re
import sys

# Complete the timeInWords function below.
def timeInWords(h, m):
    raise RuntimeError("Nope!")

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    h = int(raw_input())

    m = int(raw_input())

    result = timeInWords(h, m)

    fptr.write(result + '\n')


If you enjoyed this post, then make sure you subscribe to my Newsletter and/or Feed.