MIME Type puzzle discussion

I’m not sure where in the problem description it says that two dots in a row is not allowed, which seems to be what I’m failing at:

  • MIME types are composed of a maximum 50 alphanumerical and punctuation ASCII characters.
  • File names are composed of a maximum of 256 alphanumerical ASCII characters and dots (full stops).

For all I can see it would be OK to have a file name being “…pdf” and it should be validated to the pdf MIME

Two dots in a row are allowed.
Look at the last test case.
First name is …edi and the expected answer is application/EDI-X12

1 Like

Then I could really use a pointer to what is wrong /w my code honestly

EDIT: Found the reason. The language I am learning gives me an unexpected value back on nothing behind a last “.”

Every tests and validators work with my python3 code. The problem is on your side…

1 Like

yeah was my mistake, just discovered where I can see the test data. Thx

1 Like

i did the same thing, and i get the same your result :pensive:

Just checked my code, and I have 100% without taking care of the size of the extension. But adding the condition (size>10) still get 100%… Are you sure you are not counting the dot ?

1 Like

hhh i just see this one

I don’t able see your code, because i don’t get 100%.
By the way, I’m using c.

You’re not supposed to see it. I’m just saying that I tried what you said and that works, so you probably did it wrong. And, as I said, are you sure you don’t count the ‘.’ in the extension size?

1 Like

I’m very sure

Anyway, this verification is not required. You can just delete it and try again. If you don’t get 100%, there is a problem on another point of your code.

1 Like

thanks, I’m gonna try to figure it.

Hello :slight_smile:
same problem, same score (90%) same determination ? Lol

However, I finally found it and solved it 100%, I think it’s forbidden to tell the solution, but if someone is still stuck, write here, and I think I’ll receive an alert to be awared of a request

1 Like

i solved with python but in perl i keep getting time error on the last case

This was my first time using HASH Tables and optimized data structures in C++. NGL, it was quite a painful experience. I spent hours trying to figure out how to get my same-old arrays and vectors to work, but it just wouldn’t. I sure did learn a ton on this project.

I made versions of my code for C++, C#, Java, Javascript and Python. All of them worked, but only the Javascript was able to run the Large Dataset without timing out… so if you’re having the same trouble with the Large Dataset timing out, try making a Javascript version of your code.

It is possible to create a solution in every single programming language available on this website which works and without timing out :wink:

1 Like

I’m sure it is… I’m new at this and I just have to learn to make my code more efficient…

Yeah, for Java I only forgot to compile my regexp outside the loop :see_no_evil:
I wouldn’t have thought that the impact would be that big though. The line in question

Pattern fileExtensionPattern = Pattern.compile("\\.([^.]+)$");