Also, it doesn't look like the recruiter has any opportunity to check that their test is correct, and there's no way for the candidate to test their solution works, so if there's any issue with the way the test has been defined (eg the test was created using a signature of input:string -> string by mistake) the candidate simply can't pass. If I was taking that test and failed because the test software was incorrect I would not give the company I was applying to a second chance. Applying for a job is stressful enough without that sort of thing happening.
Lastly, as a suggestion, I'd add a feature to search StackOverflow for the function the user has entered. There'll be a lot of cases where that happens.