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.
.
A workaround is to use
String?
in the function signature.I close since this has already been raise as an issue below.
Please HELP, check the @verdugo's issue* below. There is a problem in Swift version of this question.
Best
No, You shouldn't my friend! This is a serious mistake for the Swift example. Example designed as a non-optional, but the Test case was written with an optional scenario. So, must be one or another, not both.
*** PLEASE, URGENT HELP ***
Everything depends on this question on earth right now!
Note: I was planning to listen to the "Rihanna - Diamonds" but now I'm listening to the "The Cardigans - Nil" song.
Thank you for your comment. I updated with the easy solution after thinking mathematically. And it worked like a charm.
Best.
Okay so there are two things going on here a warning and a Fatal error.
I will sort out the warning; it's not a big deal hopefully.
Your problem (and the reason the runner crashed) is the Fatal error. It occured because (I think) your lists were too large. This kata uses numbers around 100 billion so lists are out the questions.
To fix you will need to make a new solution that doesn't make use of lists or loops.
let me know if you still are unclear.
I passed the Test, but when I attempt my answer I got an error:
main.swift:32:11: warning: variable 'randomStreet' was never mutated; consider changing to 'let' constant
var randomStreet: Int = 0
~~~ ^
let
Fatal error: Unexpectedly found nil while unwrapping an Optional value: file test/solution.swift, line 18
This code not in the test cases. So I can't send my correct answer to the site.