/**
 * Given a string and a key, return a new string where each character is the xor result
 * of the corresponding character in the string and the key.
 *
 * Example:
 * xorString("hello", "key") -> "\u0005\u001A\u0012\u001A\u0005"
 *
 * @param string A string to perform xor operation on.
 * @param key A key string to xor with each character of the string.
 * @return A string where each character is the xor result of the corresponding string and key character.
 */
fun xorString(string: String, key: String): String {

    var result = ""
    for (i in string.indices) {
        result += (string[i].toInt() xor key[i % key.length].toInt()).toChar()
    }
    return result
}
/**
 * Given a string and a key, return a new string where each character is the xor result
 * of the corresponding character in the string and the key.
 *
 * Example:
 * xorString("hello", "key") -> "\u0005\u001A\u0012\u001A\u0005"
 *
 * @param string A string to perform xor operation on.
 * @param key A key string to xor with each character of the string.
 * @return A string where each character is the xor result of the corresponding string and key character.
 */
fun xorString(string: String, key: String): String {
/**
 * Given a string and a key, return a new string where each character is the xor result
 * of the corresponding character in the string and the key.
 *
 * Example:
 * xorString("hello", "key") -> "\u0005\u001A\u0012\u001A\u0005"
 *
 * @param string A string to perform xor operation on.
 * @param key A key string to xor with each character of the string.
 * @return A string where each character is the xor result of the corresponding string and key character.
 */
fun xorString(string: String, key: String): String {

    var result = ""
    for (i in string.indices) {
        result += (string[i].toInt() xor key[i % key.length].toInt()).toChar()
    }
    return result
}