-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution in Layer's Of Lasagna [Swift] #576
Comments
Could you indicate why you think it is incorrect? |
Because if you send remainingMinutesInOven a value for elapsedMinutes of 13, the output of remainingMinutesInOven is 27: expectedMinutesInOven starts at 40; 40 - 13 (elapsed time) = 27 ; 12 + 27 = 39. |
The test case for expectedMinutesInOven even explicitly expects "27" as the correct return value. The expected return value for totalTimeInMinutes can't be 25 for the values given, which are the same as the values given to test the other two functions, and those tests pass with those values while the final test does not, even with the same values. |
I think this is actually a bit of confusion, however. The third function seems to imply asking for the sum of the output of the first two functions, and that seems logical; however, what it is actually asking for is a sum of the output of the second function and the argument for "elapsedMinutes". I think at least part of this confusion is that the second parameter for totalTimeInMinutes is identical to the parameter for remainingMinutesInOven, implying that it is the output of the function remainingMinutesInOven that should be used, when in fact elapsedMinutes in the function totalTimeInMinutes is supposed to be a constant Int value instead. IMO the right solution here is to change "elapsedMinutes" in the third function to be some other name. It invites confusion to use identical labels for two different concepts. |
The solution for Test #4 is expecting "25" as it's answers, however the correct answer should be 39. Could be a error with the way the test code was written.
The text was updated successfully, but these errors were encountered: