Help!
Your tests timed out. This might mean that there was an issue in our infrastructure, but more likely it suggests that your code is running slowly. Is there an infinite loop or something similar?
Please check your code, and if nothing seems to be wrong, try running the tests again.
I ran your code in Xcode playgrounds and it appears it doesn’t like the nested calculations going on for setting the x & y properties. Try breaking some of the logic out into separate lines (see example code) which will have the added benefit of being more it more human-readable and help others understand your code better…
Example Code:
func workdaysIn(budget: Double, hourlyRate: Int, withDiscount discount: Double) → Double {
let dailyRate = TODO calculate daliy rate
let discountedDailyRate = TODO calculate daliy rate
let workdays = (budget / discountedDailyRate).rounded(.down)
return workdays
}
From the Swift Style Guidelines…nothing wrong with a few extra lines of code if it improves intention/readability!
“Clarity is more important than brevity. Although Swift code can be compact, it is a non-goal to enable the smallest possible code with the fewest characters. Brevity in Swift code, where it occurs, is a side-effect of the strong type system and features that naturally reduce boilerplate”