7 kyu
Cipher from math problem
468user9015794
Loading description...
Cryptography
Mathematics
Ciphers
Algorithms
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.
There are two tests that give me a float value when decrypting, even though all inputs should be valid. All tests pass except two and they both are resulting in a float when doing the reverse math of encrypting. What could be my issue here?
use x // 3 not x / 3, the first operation will return an integer value (automatically rounds it) whereas x / 3 can return a float if that is the result
Description does not specify what to do when
n
is negative and can only be inferred from sample tests.Is there anything special to do then? I didn't care about that and my solution passed on first attempt, just applying the algorithm.
Issue resolved
This comment has been hidden.
Approved
You approved while I was solving and about to raise duplicate issues on encryption + decryption ughhhhh....
Oh sorry, my bad then. Is this kata a duplicate?
Yeah...
This comment has been hidden.
(the kata was published but got pushed to draft automatically with the second issue opened)
note: the types being different, that would be a rather different kata.
Ah OK I didn't know about that feature - I thought the link had been shared privately or something, I didn't want to intrude on someone's private draft!
Thanks,
(that feature has been introduced some days/weeks ago)
I wonder why Codewars didn't notify every user that a new feature was added
While the description does say the input will be valid, it does not clearly specify what the input may contain. It is generally understood that words are made of letters, but it should specify that there will be no special characters such as any punctuation, and in fact that all letters will apparently be only lowercase.
I changed the description. Thank you for pointing this out.
Hi,
length = random.randint(-9999, 10)
=> 99% of the inputs will be empty.number = random.randint(-9999, 10)
=> 99% of the transformations will be applied 0 times.Cheers
Thank you, I fixed it.
not exactly: you still ahve negative values in there =>
randint(0,100)
for numberOk, changed it to
randint(-1, 31)