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.
Fixed!
Fixed!
.
I'm sorry, I'm still not seeing how one would make the ternary usage compile, even if they just return the hard coded answers.
However, I'll give you that a random test is not so hard to implement. I have added them!
.
The reason why I don't see a need for Random tests, is that I'm tasking the solver to make the following line compile
val booze = (age < 21) ? "Cranberry" | "Cosmo"
Ofcourse I could randomly change the boolean condition, But if they're able to make the usage of ternary operator compile, I believe they have solved this Kata.
This comment is hidden because it contains spoiler information about the solution
Added a comment clarifying this!
This comment is hidden because it contains spoiler information about the solution
Thanks a lot for your patient review!
Corrected everything listed here, expect for changing Secondly to Second.
Personal preference, but I liked the flow of the sentence as it is now.
Open to change in other people also prefer "Second"!
I don't know if there would be any difference between the two, picked 2 on a whim!
Corrected as much as I could spot!
A list of all oversights would be greatly appreciated!
I'm going to give you a few general hints, which applies to ALL problem solving challenges like this.
"Start with the extremes": Instead of starting for a generic N, maybe start with 1.
If you havent already, try getting out a pen and paper, and workout a few examples, and try and spot a pattern. Also, you are tasked to find the value for f(n), so try to be deliberate on this "intermidiate" value. Keep this in your mind, when looking for patterns.
Anymore than this, unfortunately will give away too much, and I don’t want to rob you of the satisfaction when you finally solve this!
.
@scala.annotation.tailrec will compile this into a loop!
Loading more items...