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.
This task is not only interesting one, but also this seria's katas are practically useful.
Thank you.
It seems the test cases in the Swift version of this Kata has errors:
I've tested my code against all the test cases and I get the correct results:
All test print
true
!! Can someone please sort this out?Yup, you got that right.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thanks, that's clear now - still got bugs but getting closer to solution!!
Lift was going up...
Person at floor 6 wants to go up... keep going up.
IIRC the empty lift rule applies only when that rule can't.
Really excellent and challenging kata!
I am, however, stuck on what seems to me to be a conflict between 2 of the lift rules:
For example: lift is going up and discharges all passenger at floor 3. There are 2 people waiting at higher floors say, 1 at floor 6 wanting to go to floor 10 and 1 at floor 9 wanting to go to floor 5.
Does it
or
Option b) seems the more logical but appears to conflict with the empty lift rule. I'm probably just being dense, but would really appreciate some clarification.
That is exactly right. Your brain defrags overnight, providing clarity and answers when you awake.
This comment is hidden because it contains spoiler information about the solution
Phew!!!! Had to ressurect some defunct brain cells to get this one done - quite tricky for non-mathematicians!!
Would be helpful if the description gave the range of test cases the code was expected to pass!! Particularly since one of the test cases contained an invalid string in the input - what should be the expected behaviour for this case? Assume zero or raise exception?
@evanmdort - nothing wrong with your thought process coordinates of the corners of the rotated rectangle are [0.707,3.53],[-3.53,-0.707],[-0,707,-3.53],[3.53,0.707]. Neither the picture nor your thought process is wrong, the problem must be in your computation of the integer coordinates contained in the rotated rectangle. What is your algorithm for finding these points?
Hmmmmmmmmm!!
Really enjoyed this Kata - kudos to author!! Expresion trees are something I've never really understood in the past; writing a solution to this challenge has taught me how they work. Got a bit caught out by unary '-' which I assumed would always precede a numeric literal - WRONG!!
Loading more items...