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.
i did this first but i didn't i fked up the last part then later went with the best practice solution
Thanks for this.
You can use just "e", without +
Clever, and easy to understand.
Can you give examples of when they don't work?
Pure genius!
matter of habit
For Swift
let longRoutes = [["San Policarpo", "Oras"], ["Balangiga", "Lawaan"], ["Borongan", "Maydolong"], ["Jipapad", "Maslog"], ["Balangkayan", "Llorente"], ["Mercedes", "Guiuan"], ["Taft", "Sulat"], ["Sulat", "San Julian"], ["Arteche", "San Policarpo"], ["Oras", "Dolores"], ["Dolores", "Can-avid"], ["Can-avid", "Taft"], ["San Julian", "Borongan"], ["Maydolong", "Balangkayan"], ["Llorente", "Hernani"], ["Hernani", "General MacArthur"], ["General MacArthur", "Giporlos"], ["Giporlos", "Balangiga"], ["Lawaan", "Salcedo"], ["Salcedo", "Mercedes"], ["Maslog", "Arteche"]]
XCTAssertEqual(findRoutes(routes: longRoutes), "Jipapad, Maslog, Arteche, San Policarpo, Oras, Dolores, Can-avid, Taft, Sulat, San Julian, Borongan, Maydolong, Balangkayan, Llorente, Hernani, General MacArthur, Giporlos, Balangiga, Lawaan, Salcedo, Mercedes, Guiuan")
OH!
This comment is hidden because it contains spoiler information about the solution
It does not necessarily and it is risky to assume so. They are returned in insertion order.
[Edit: to be precise, I did not found any insurance that going that way - with the constructor - will keep the insertion order]
This comment is hidden because it contains spoiler information about the solution
Sorry. I forfeited eligibility and looked at the solutions. I see, issue removed.
Thanks!
Your code does not work properly when the number you are considering is a legitimate
0
, in which case you just use the default value.[I would also just use a
.reduce()
without using any mapping for performances - really no point in creating temporary variables here -, but that is as a side note.]Loading more items...