/**
 * Given a string and a shift value, modify the string to shift each letter by the given value.
 *
 * @param string The original string.
 * @param shift The amount each letter should be shifted.
 * @return The modified string with shifted letters.
 *
 * Example:
 * shiftLetters("hello", 2)
 * Output: 'jgnnq'
 */
fun shiftLetters(string: String, shift: Int): String {

    var newString = ""
    for (char in string) {
        if (char.isLetter()) {
            var newChar = ((char.toLowerCase() - 'a' + shift) % 26 + 'a'.toInt()).toChar()
            if (char.isUpperCase()) {
                newChar = newChar.toUpperCase()
            }
            newString += newChar
        } else {
            newString += char
        }
    }
    return newString
}
/**
 * Given a string and a shift value, modify the string to shift each letter by the given value.
 *
 * @param string The original string.
 * @param shift The amount each letter should be shifted.
 * @return The modified string with shifted letters.
 *
 * Example:
 * shiftLetters("hello", 2)
 * Output: 'jgnnq'
 */
fun shiftLetters(string: String, shift: Int): String {
/**
 * Given a string and a shift value, modify the string to shift each letter by the given value.
 *
 * @param string The original string.
 * @param shift The amount each letter should be shifted.
 * @return The modified string with shifted letters.
 *
 * Example:
 * shiftLetters("hello", 2)
 * Output: 'jgnnq'
 */
fun shiftLetters(string: String, shift: Int): String {

    var newString = ""
    for (char in string) {
        if (char.isLetter()) {
            var newChar = ((char.toLowerCase() - 'a' + shift) % 26 + 'a'.toInt()).toChar()
            if (char.isUpperCase()) {
                newChar = newChar.toUpperCase()
            }
            newString += newChar
        } else {
            newString += char
        }
    }
    return newString
}