about | help | code help+videos | done | prefs |
(MEDIUM) Given an input String, change it into a String comprised of characters representing the difference between the sequential character values, considered as numbers, but shifted to be in the range 32-126. Consider the input "ABC" - this is made up of the values 65, 66, 67. The resulting differences are 1 (which came from 66-65), 1, and -2 (which came from 65-67, the difference between the last and first characters). These become 33 (1 more than 32), 33, 125 (2 less than 32 which wraps around to the end of the sequence) which becomes "!!}" in the ASCII table. Precondition: the plaintext only contains characters in the ASCII visible range (32-126), and the plaintext length is at least 2 characters.apcsaEncryptDifferences("ABC") → "!!}" apcsaEncryptDifferences("0123456789") → "!!!!!!!!!v" apcsaEncryptDifferences("abcdefghijklmnopqrstuvwxyz") → "!!!!!!!!!!!!!!!!!!!!!!!!!f" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 230
Copyright Nick Parlante 2017 - privacy