Ad
  • Custom User Avatar

    Thank you for the feedback!

    I have cleared up the description to clarify your points and modified test cases a little.

    entry will always consist of 8 chars in a string and should be treated as such — you do not need to validate that it forms a real date.

    If an item is missing / row is deemed invalid, return an empty string "" - do not discard the entire dataset.
    (That was my bad, I did forget to implement that check in the tests. Should be aware of the dataset not allowed to be fully dropped when at least one row is valid now.)

    Note that you cannot assign multiple values to one item
    and
    If multiple possible matches exist for a field (e.g., multiple single-letter values that could be name_t), use the first one that fits according to the schema inference rules.

    Hope that cleared things up a bit and I have revised it properly.
    More feedback is welcome!

  • Custom User Avatar

    Yes, discipline is set to "Puzzles" and this does take a bit of working with the information given to figure out.
    I have updated the description a little to be more clear.

    Your task: reconstruct the original table rows from the corrupted export file.

    Mind telling me what exactly you have attempted in your experiments / want a tip on how to solve it?

  • Custom User Avatar

    I finally managed to put together a solution that passes the full tests. I had to guess at a lot of unstated specifications. Here are the issues I had:

    • It wasn't clear that the entry column should have a valid DDMMYYYY/YYYYMMDD date. It seems as if any 8-digit string is acceptable.
    • Based on trial-and-error, I was able to figure out that you should discard rows that don't have 7 values. However, if a row has 7 values and there's no way to properly assign them to the schema, it is unclear whether you should throw out just that row or the entire input (my solution does the latter and passed the full tests).
    • It is unclear if a valid row will ever have more than 1 valid value assignment. For instance, for the input "B,1420,C,staff,no,20112020,4", both name and name_t could be either "B" or "C".
  • Custom User Avatar

    I've done quite a few experiments, to no avail. Is this a puzzle?

  • Custom User Avatar

    Thanks for the feedback!
    I added 5 more example tests (now there are 7 in total) for the user to see / experiment with.

    Think that is sufficient, or are more necessary?

  • Custom User Avatar

    You need much more sample tests.

  • Custom User Avatar

    Respect for keeping it THAT short and effective!

  • Custom User Avatar

    Hi!
    Genuinely curious, how long did it take for you to write all that code?
    Looks pretty advanced.