eg: if x=127 and r = 5
1st digit 1+5=6; 2nd digit =2+5=7; 3rd digit = 7+5=12---> 3 (sum of digits 1+2 =3)
then output y= 673
if there are more inputs - consider last one as r and store output as y(1),y(2)...etc
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers14
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15777 Solvers
-
588 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
679 Solvers
-
Generate a string like abbcccddddeeeee
274 Solvers
-
Reverse the elements of an array
1109 Solvers
More from this Author33
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I am not sure this method can be called a cipher since there is probably no way to recover the original number. You should probably call it a hash.
yeah, that's right. Thanks, I changed it to hash and changed some test cases too.
Clearly, need a new test case to eliminate solutions that define isequal() to always return true.