Daily challenge for 2026-02-14
410. Sum of Adjacent Character Codes
Given a string s, return a new string where each character is replaced by the sum of its ASCII value and the ASCII value of the character immediately following it. The last character should wrap around and use the first character for its sum calculation. The output should be a string where each position contains the character corresponding to the calculated sum (using modulo 128).
Example:
Input: s = "abc"
Calculation:
- 'a'(97) + 'b'(98) = 195. 195 % 128 = 67 ('C')
- 'b'(98) + 'c'(99) = 197. 197 % 128 = 69 ('E')
- 'c'(99) + 'a'(97) = 196. 196 % 128 = 68 ('D')
Output: "CED"
Run this challenge interactively in Python or JavaScript when the app loads.