Problem 47970. Cipher or decipher the number according to the second input - 10 keys
There are several bugs in the testsuite:
1) You cannot call cyp((x,y)) with double parantheses (occures twice)
2) for x='97256528638204' the string is too short. Likely there is a leading zero missing.
A few of the errors have been fixed, but this problem is too cryptic (or erroneous) for me to understand it, so I can't completely fix it. @Sibi, please fix the problem. I would highly recommend providing your own reference solution on the Edit page to ensure that it is working properly.
Ok, so there is a problem with test#3 because the input number has 14 digits, but the output number has 15 digits, which means the input is missing a leading 0. Until this is fixed, we need to manually add a leading 0 whenever the test#3 input is found, which is probably different from what the author wished because the number of leading 0s changes which key is applied to each position (confirming cokakola's suspicion).
Problem Recent Solvers5
More from this Author33
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!