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.
30 bytes is a bit excessive. "Hello World\0" is 12 characters long.
JaywalkerZA,
Your instructions say:
"Please write me a function that will return the shortest amount of button presses to get to the given time (As displayed on the screen)."
This to me means that if I'm given say "01:30" then the "shortest amount of button presses to get the given time" is 3 or "90" and enter. The instructions are not clear.
I've hard coded my answers for "01:05" and "01:23" because it was not clear that you wish for us to write the input exactly. You should provide "01:01" as an example test case for this to be clear to future participants.
I think it should be fixed.
This comment is hidden because it contains spoiler information about the solution
I have a problem with C when running the tests for submission. Using the following tester main() function:
When tested in the terminal I get:
The answer is correct yet I fail on the fifth test.
I have the same problem with C with the following output:
When tested in the terminal I get:
The answer is correct yet I fail on the last test.
I think that I understand it better now. For those who are still uncertain I think the pattern is as follows:
27 -> base26 = 11.
printf("%c%c", allow[1], allow[1]);
Whenever another 26 gets added (for base26) we add a digit to the second column. Similar to how hexadecimal works.
52 following this pattern would equal 20 so "ca".
0
is the first number of dec, anda
is first letter in alphadec is base 10, so
27
is27 = 2 * 10 + 7
.allow has 26 chars, is base 26.
a
is0
,b
is1
,c
is2
... andz
is25
. sobb = b * 26 + b = 1 * 26 + 1
.Do you understand better now?
This comment is hidden because it contains spoiler information about the solution