HackerRank ‘The Time In Words’ Solution

H
Short Problem Definition:

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

Link

The Time In Words

Complexity:

time complexity is O(?)

space complexity is O(?)

Execution:

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.

Solution:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/python
 
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')
 
    fptr.close()

About the author

Add comment

By admin

Mailchaimp

About Me

I like to Code and Love to share the codes.