Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Groovy Translation
I'm pretty open for changes on this translation since it may not be 100% the same as in the Python translation
Improved Java translation
Description not detailed enough. It should be clarified that www is the only subdomain and http(s):// the only protocol being tested against.
Current solutions will not work reliably for most real-world URL's.
Here are some url-patterns that should also be tested:
The wording of the description is confusing as it actually wants a hostname returned, not a domain name. Aditionally, I encountered issues around the .co.za TLD
This comment is hidden because it contains spoiler information about the solution
Would be better if the description specified that the test cases are not expecting sub-domains (other than www). Most of the solutions here (including mine ;)) would fail on a URL like https://dev.example.com/.
Scala translation
C# translation ready! Please review and approve.
Most if not all posted solutions are incorrect.
A URL may have any number of subdomains, and may have a large variety of suffixes (see: https://publicsuffix.org/list/).
For example:
http://some.subdomain.mail.google.sth.ac.at
Is a valid URL. This project attempts to address the problem, but is clearly beyond the scope of this Kata (as it is marked #regex): https://github.com/lupomontero/psl.
The instructions should be modified to state what subdomains and suffixes are allowed.
Note that the test cases do not include any url with more than two dots in prior to the first
/
, likewww.google.co.uk
. It could be a good idea to include this kind of url, which could change an accepted answer somewhat.I was looking to try it in Typescirpt.
Not found.
Then i decided that i can translate it.
But i found out there is pending typescript translation
Maybe someone can approve this (or make some comments, so we could improve it and finally merge)?
This comment is hidden because it contains spoiler information about the solution
I'm able to get it to pass for all the test cases that are listed. But when I attempt it fails, and I'm not sure what url is failing it.
Would be nice if the test cases were expanded and I could write my code accordingly : O.
I feel like you should add non https requests like http:// and ftp://, as those are both valid URLs that are not covered by your tests
Loading more items...