MIME Type puzzle discussion


#302

In the PHP version, the auto generated input-parser skeleton code is wrong.
$FNAME = stream_get_line(STDIN, 55 + 1, “\n”); // One file name per line.
It should have 256 instead of 55. The large dataset validator fails with 55.

It cost me lots of extra time to find this bug - I thought my code was buggy while it was fine and the provided code was the faulty…


#303

Thank you man !
I’m new to c# and coudn’t find a solution to beat that final test !
Dictionnary saved the day.


#304

I passed all test cases in C but I do not understand what is needed to validate limit sizes in extensions and filenames. I validated limit size in MIME types but I did not do something in particular.


#305

Hi everyone !

I’m trying to do this challenge but there is a problem with my output stream… When I write “UNKNOWN” in the output stream, the only answer that the challenge find from me is “Nothing” although the output stream show me there is indeed a “UNKNOWN” printed… Has anybody already met this issue ?
(I use Python3.)

Thanks for you reply !


#306

Are you sure the UNKNOWN is on the output stream? Did you maybe print it on the error stream instead while debugging?


#307

@DanielLeidenheimer if you are failing “upper to lower” and nothing else, you’re almost there of course. just make sure your dictionary and file_extension are BOTH in the same case.


#308

</Bash coding/>
I’m really stuck on “large dataset” test :frowning_face:

i use associated Map with EXT : EXT_MIME[${EXT}]=$MT
(EXT in lowercase if i found upper case : [[ “$EXT” == [[:upper:]] ]])

when reading the entry files (For Loop) i try to minimize all commands…as explained by some fellows in this thread.

i use “continue” when needed
“When used in a for loop, the controlling variable takes on the value of the next element in the list.”

check dot on filenames : Dot=expr index $FNAME "."
if [ Dot -eq 0 ] so UNKNOWN ; continue
else
retrieve the file extension : FNAME_EXT=""${FNAME##*.}""
check if the EXTension is Empty : [ -z ${FNAME_EXT} ]
(if FANME_EXT in lowercase if i found upper case : [[ “$FNAME_EXT” == [[:upper:]] ]])
if the case so UNKNOWN ; continue
else
check if the MAP retrieve a MIME Type : [ -z “${EXT_MIME[${FNAME_EXT}]}”
if not the case so UNKNOWN ; continue
else
retrieve the right MIME Type

i have only 47 lines of code.


#309

bonjour,
j’ai un petit problème sur le puzzle MIME type au niveau facile.
Lors du 5eme test (grand volume de données), sur le deuxième fichier (‘marcelpatulaccibrigadierchefmaisgardiendelapaixavan’), je renvoie ‘UNKNOWN’ et le validator attendait ‘image/jpeg’. Il n’y a pas d’extension …
je ne comprends pas.
Par avance merci pour votre aide
bien cordialement


#310

finalement j’ai trouvé en regardant dans le forum. Mon code n’était pas faux, c’était juste le ‘stream_get_line’ en PHP qui était mal configuré et qui ne prenait que 55 caractères au lieu de 256. Donc le $FNAME du skeleton était tronqué…


#311

Hi everybody, I’m new in the CodinGame community. I am trying to solve the MIME puzzle, and I was able to get a success using simple arrays, except for the “Large data” challenge which I cannot succeed…
I have tried to use hashtable or dictionnary to speed up the process, but everytime I try to create such table, I get the following error message “error VBNC30451: ‘Dictionary’ is not declared. It may be inaccessible due to its protection level.”.

Would anyone know how to solve this issue ? I am using VB.NET FYI


#312

It seems there are missing “Imports System.Collections.Generic”


#313

Great that worked ! Thanks a lot man, I struggled for several hours today trying to understand why I could not declare a dictionary ! I’ll remember that