6 kyu
Combination Lock
36 of 245bsylve
Loading description...
Mathematics
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I was taking the difference between rotating right and rotating left, but we are expected to ignore direction, and just some all of it together. I suppose noone else misread the description like I did ..
added a note:
In my world the clock turns in the opposite diretion.
bro , tell me how to change my avatar
@IMMERSION_ The only way you can change avatars is by linking your profile to Github account (As of now). Such feature might be implemented in the future and is already within backlog
JavaScript translation
TypeScript translation
approved
Cool kata, but cool head is important for a cool finish!!
the way i see it,
0, 30, 0, 30 needs to move 210 units = 210 * 9 = 1890 degrees 0, 20, 0, 20 needs to move 180 units = 180 * 9 = 1620 degrees 0, 10, 0, 10 needs to move 150 units = 150 * 9 = 1350 degrees
no clue what am i missing? Any suggestion? Anybody?
Hi, Quark Fox!
Have a look at the example (0, 30, 0, 30) once again:
According to the instruction steps(#1, #3) you have a value of 360 times 2(#1) + 360(#3), which is 1080. Now add this to 90*3 and you get 1350.
Hope that helps.
Thank, you very much!
Sorry, i still don't get it. Why rotating the dial clockwise (instruction step#2) from zero to 30 will take 90 degrees;
I am not sure what is the way to calculate the degree.
I just think the formula should be:
With clockwise start from 0:
0 -> 10 : 90 degree
0 -> 20: 180 degree
0 -> 30: 270 degree
With counter-clockwise start from 0:
0 -> 30: 90 degree
0 -> 20: 180 degree
0 -> 10: 270 degree
Can any one explain what's wrong with my formula?
------UPDATE------
After researching for a while, i realize my assumption is wrong.
The formula should be opposited base on the picture.
https://www.art-of-lockpicking.com/wp-content/uploads/Open-a-Locker-Lock-Step-1.webp
It help me visual the problem easily more than the image in task.
In my world the clock turns in the opposite diretion.
thanks i get it now
Following up on the question below: the description could use a line that clarifies that the numbers/markings are on the dial, not the casing. Perhaps simply asking the user to look closely at the provided image. Anything to clarify this, because I was stumped for a while until I read the discourse below.
done
Let's see the first example: 0, 30, 0, 30 -> 1350
Total: 720 + 270 + 360 + 270 + 270 = 1890, not 1350
What am I doing wrong?
Stop at the first number of the combination: 0 -> 30: 270
Look at the image of the lock provided. How many degrees of clockwise rotation gets you from 0 to 30?
270 degrees, going clockwise
When you rotate the dial clockwise, what happens to the number shown on top?
*facepalm*
You not wrong, the clock's direction is wrong!
Please be more specific with these two steps. Do I always do two full clockwise turns (720 degrees) and then rotate some more to reach the first number (and if so, which direction should I turn to reach the first number -- clockwise, counterclockwise, or whichever is shorter)? Or do I first do a single clockwise turn (360 degrees) and then continue turning clockwise until I reach the first number?
Two full turns clockwise and then continue clockwise until you reach the next number.
Not closing the issue because I too think the steps should be made clearer.
Edited
Thanks. Sorry, I got really busy this past month and should be more active now to keep up with changes.
The example/sample tests are not very good, they only consist of the combination of 2 different distances and 3 different offsets. There might as well be only the first 3 example tests; there is no point in supplying several tests that test the same thing.
I added two more tests cases that have more variation.
intial
Thanks. Gotta Love Typos
Initial code is still
intial
.I think I fixed all the typos.