Back to problems

Caesar Cipher with Case Preservation

Algorithm · Amazon · Easy

Requirements Implement the following function: Move each alphabetic character by the specified fixed shift, wrapping only inside its own case range: uppercase letters remain within A-Z, and lowercase letters remain within a-z. Keep every letter’s original case. Return digits, punctuation, whitespace, and all other non-letter characters exactly as they were. Examples Example 1 Input: Output: A and b advance by two, y wraps to a, Z wraps to B, and the remaining characters do…

Checking your access…