Ad
  • Custom User Avatar

    I've done all tests and submited. Two tests are passed and with the third I'm getting... "Value is not what was expected" - it's not so descriptive to be honest, could you fix it?

  • Custom User Avatar

    I think that there's some kind of a strange behaviour in JS because in test cases (and in submit) variable 'data' is being overwritten by every call. It's pretty messed up.

  • Custom User Avatar

    This solutions is slightly incorrect for it's not working for every given year.
    Let's say we have a year (Just an assumption) 11100.
    It will return a proper age but wrong suffix.
    Your algorithm is not following a rule where every number with tens digit number has to be suffixed with 'th'.
    Even tho, I think it's a very clever idea and it needs just a bit of polishing.

    Btw. I know that my example is quite strange but I just think that algorithm written once should be able to handle cases for years without need of being rewritten. :)
    I will optimize and correct my own answer and show it to the world.