/**
 * This function takes a game map and a level number as input and changes the game level accordingly.
 *
 * @param gameMap The current game map with different levels represented by different characters.
 * @param levelNum The level number to be changed to.
 * @return The modified game map with the updated level.
 *
 * Example:
 * gameMap = ['0', '1', '2', '3', '4']
 * levelNum = 2
 * changeGameLevel(gameMap, levelNum) // Output: ['0', '1', '2', '3', '2']
 */
fun changeGameLevel(gameMap: MutableList<String>, levelNum: Int): List<String> {

    // Get the index of the current level
    val currentLevelIndex = gameMap.indexOf(levelNum.toString())

    // Perform bit manipulation using left shift operator
    gameMap[currentLevelIndex] = (levelNum shl 1).toString()

    return gameMap
}
/**
 * This function takes a game map and a level number as input and changes the game level accordingly.
 *
 * @param gameMap The current game map with different levels represented by different characters.
 * @param levelNum The level number to be changed to.
 * @return The modified game map with the updated level.
 *
 * Example:
 * gameMap = ['0', '1', '2', '3', '4']
 * levelNum = 2
 * changeGameLevel(gameMap, levelNum) // Output: ['0', '1', '2', '3', '2']
 */
fun changeGameLevel(gameMap: MutableList<String>, levelNum: Int): List<String> {
/**
 * This function takes a game map and a level number as input and changes the game level accordingly.
 *
 * @param gameMap The current game map with different levels represented by different characters.
 * @param levelNum The level number to be changed to.
 * @return The modified game map with the updated level.
 *
 * Example:
 * gameMap = ['0', '1', '2', '3', '4']
 * levelNum = 2
 * changeGameLevel(gameMap, levelNum) // Output: ['0', '1', '2', '3', '2']
 */
fun changeGameLevel(gameMap: MutableList<String>, levelNum: Int): List<String> {

    // Get the index of the current level
    val currentLevelIndex = gameMap.indexOf(levelNum.toString())

    // Perform bit manipulation using left shift operator
    gameMap[currentLevelIndex] = (levelNum shl 1).toString()

    return gameMap
}