Those kind of puzzle require more than just the basic algorithm, “gotta go fast!” is the key point. I’m not fluent in shell scripting so I can only give you a general advices:
Break a for or while loop whenever you can. Those can really slow down your processing time
Try to limit action that takes a lot of time on large list: for and while but also sorting can be really long
Turn around your code completly once in a while to test different method. Sometimes you can find really improved way of doing things.
That’s all for my basic advices. Honestly MIME Type didn’t put me in a lot of trouble but horse racing dual did, don’t hesitate to go to the topic that speak about it: Horse racing dual topic
Hi ! I have a problem with this puzzle. When my output is good, it write “Found: Nothing”, but if it something else, it write it. For example, for the first test, if I write “image/gif” It say “Found: Nothing”, and if I write “imgae/gif” it say “Found: im”. It does it even if I print it directly, without doing anything else.
Just a hint for people using Python(2/3).
I just created a hash that associates extension to mime type. Despite that, i failed the large dataset test and file extension test. But thanks to the post of nickmaovich i realised that the problem came from the way i obtained the extension.
As i am a bit lazzy i used os.path.splitext method to get the file extension. This is a very convenient way but it takes time.
After coding my own way to get the extension i got a 100% score.
So be careful to python modules
Hi,
I make this game in PHP, and I can’t have the points for “Limite size in filenames”, but I don’t understand why.
I make the test of length, and if it’s too long, I answer “UNKNOW”.
Can you help me?
Thanks,
Hi i just spend few hours to figure out that my program made mistakes with files named like:
.txt
I took me so long because such files are only in this large test. So my question is to put one of those in shorter tests. Or implement something what would say where the mistake is, as I did
It’s great but how the hell I can do this in PHP? There are no restriction on variable I create, it does not have type and length, so I define array and populate it with values, it’s not like in Java, where I MUST say this variable will be String and length max of 10 characters. How to solve it in PHP?