Back
Close

Detective Geek

Statement

 Goal

Detective Geek has a superpower of knowing when and where a crime is going to happen; unfortunately his superpower is encrypted, and he takes a lot of time decrypting it.
Everytime he sees a crime using his superpower he starts writing on paper and the result looks like this:
#*######*#*
mayjul sepsep octapr octsep sepjun octjan

As he is the one and only detective geek he wanted to write a program to help him decrypt faster.

The first line represents binary: #*######*#* becomes 10111111010
This equals the decimal number 1530, which means the time when the crime is going to happen is 15:30.

The second line encodes the address where the crime will take place. Every word in the encrypted address represents a character in the real address.
A word such as octapr can be split into two strings of length 3 oct and apr which are abbreviations for months october and april.
Each month represents a number according to its order in the year. "jan" = 0, "feb"= 1 ,"mar"= 2 ... "dec" = 11
The string of two months represents a two-digit base 12 number. So octapr is 93
93 in base 12 becomes 111 in decimal
and the final step is to look in ascci table to see what letter correspond to 111.
so octapr -> "o"
Input
line 1 : time string representing the time
line 2 : address string representing the address
Output
line 1 : time in hh:mm format
line 2 : decrypted address
Constraints
date : contains only # and * ,1<=length<13, represents a valid 24-hr time.
adress : 5<=length<100, decodes to printable ASCII characters.
Example
Input
#*######*#*
mayjul sepsep octapr octsep sepjun octjan
Output
15:30
6hotel

Tags
CryptographyLoopsArraysstring

Difficulty
Easy

Test cases
Test
Input
#*######*#* mayjul sepsep octapr octsep sepjun octjan
Output
15:30 6hotel

Validator 1 Validator
Input
#*#** mayjun mayjan mayjan mayapr marsep juljan sepfeb octjul octjul octapr octmar marsep junsep octjul sepoct octnov sepjun
Output
00:20 5003 Harron Drive

Algeria Test
Input
#**##**###* sepjul octjul sepjun octaug sepsep junsep sepjun sepjun sepmay marsep octjul sepjun octaug octsep sepfeb octoct octjul sepfeb octmar octsep
Output
12:30 freshDeed restaurant

Validator 3 Validator
Input
###*####*** mayfeb mayfeb mayapr marsep junoct octfeb sepjun octjul octaug octapr octmar marsep julnov octapr sepfeb sepmay
Output
19:12 113 Emerson Road

Egypt Test
Input
##*#**#** maysep mayfeb marsep junoct octjan marsep jundec sepsep octapr octjul sepjul sepfeb marsep junoct octjan marsep augjan octapr sepaug sepfeb octjul sepjun novfeb sepfeb marsep juldec octsep aprnov marsep julnov sepfeb octfeb octjan marsep juldec octsep sepfeb octsep sepoct octapr octmar
Output
04:20 81 El Ghorfa El Togareya St. Raml Station

Validator 4 Validator
Input
#**###*##* maymar mayaug marsep juljun octapr sepsep sepfeb octfeb sepjun sepmay marsep augjun octapr octoct octaug sepjun sepjul marsep juldec sepjun octjan sepoct octfeb marsep juldec octsep aprnov aprsep marsep juljan junoct julmay julfeb julaug julsep julaug julmay julfeb juldec
Output
06:30 27 Mohamed Yousef Selim St., HELIOPOLIS

India Test
Input
######*### maymay maymar aprdec mayapr mayfeb aprsep marsep julaug octmay octmay marsep junaug marsep mayfeb mayfeb mayapr aprsep marsep juljul sepjun octdec marsep juljun octapr octsep sepoct marsep juljul sepfeb sepaug sepfeb octjul
Output
10:15 42/31, Opp C 113, New Moti Nagar

Validator 5 Validator
Input
##*#*##*** jundec aproct mayfeb mayfeb aprsep marsep jundec sepjun octfeb marsep julsep octjan sepfeb novmar sepfeb aprsep marsep julfeb octmar sepjul sepfeb octmar octsep octjul novfeb marsep julnov octapr sepfeb sepmay aprsep marsep julfeb octmar sepjul sepfeb octmar octsep octjul novfeb marsep julnov octapr sepfeb sepmay
Output
08:56 G-11, Gem Plaza, Infantry Road, Infantry Road

Japan Test
Input
#***#*#**### mayfeb mayaug mayfeb aproct mayfeb mayjan maysep mayaug aprsep marsep augjun sepfeb octjul sepfeb sepoct sepapr sepsep octapr aprsep marsep juldec sepsep sepoct octmar sepnov octoct sepdec octoct aproct sepdec octoct aprsep marsep augjan octapr sepdec novfeb octapr
Output
22:15 171-1087, Yaraicho, Shinjuku-ku, Tokyo

Validator 6 Validator
Input
#*****#* maymay maymar mayjan aproct mayfeb mayjan mayapr mayjan aprsep marsep julapr octapr octjul octapr octfeb octapr sepaug sepfeb octdec sepfeb sepdec octoct marsep julaug sepsep sepfeb octjul sepfeb novfeb sepfeb octfeb sepfeb aprsep marsep julaug octaug sepsep octoct aproct octaug sepsep sepoct aprsep marsep julfeb octdec sepfeb octsep sepjun
Output
01:30 420-1030, Koromogawaku Oharayama, Oshu-shi, Iwate

Italy Test
Input
##**##*#*** augmar sepoct sepfeb marsep julmay sepjun octapr octmay sepfeb octjul sepmay sepoct marsep mayaug mayjun
Output
16:40 Via Leopardi 75

Validator 7 Validator
Input
##****#**** augmar sepoct sepfeb marsep junsep octoct octapr octfeb octapr marsep mayfeb mayfeb mayjan
Output
15:52 Via Duomo 110

South korea Test
Input
##*#*### mayfeb maymar mayjun aproct mayaug aprsep marsep augapr octapr octmar octmay novfeb sepjun octapr octmar sepaug marsep maymar aprmay sepoct aprjun aproct sepmay octapr octmar sepaug aprsep marsep jundec octoct octfeb sepoct aproct octaug sepoct aprsep marsep jundec novfeb sepjun octapr octmar sepaug octaug sepfeb octmar sepaug sepmar octoct sepdec aproct sepmay octapr
Output
02:15 125-7, Wonpyeong 2(i)-dong, Gumi-si, Gyeongsangbuk-do

Validator 8 Validator
Input
#**##***#** mayapr mayjun mayjul aproct mayfeb aprsep marsep juldec sepoct octmar sepnov sepjun octapr octmar sepaug marsep maymar aprmay sepoct aprjun aproct sepmay octapr octmar sepaug aprsep marsep augjun sepfeb octmar sepaug sepapr sepsep sepjun octapr octmar aproct sepaug octoct aprsep marsep juldec sepjun octapr octoct octjan
Output
12:20 356-1, Sinjeong 2(i)-dong, Yangcheon-gu, Seoul

Solution language

Solution

Stub generator input