/**
 * Given a list of strings and a boolean value, the function combines all the strings
 * in the list together. If the boolean value is true, the function reverses the order
 * of the strings before combining them.
 *
 * @param strings A list of strings.
 * @param boolValue A boolean value.
 * @return The combined string.
 *
 * Example:
 * combineStrings(listOf("Hello", "World", "Python"), false)
 * Output: "HelloWorldPython"
 *
 * combineStrings(listOf("Hello", "World", "Python"), true)
 * Output: "nohtyPdlroWolleH"
 */
fun combineStrings(strings: List<String>, boolValue: Boolean): String {

    val combinedString = if (boolValue) {
        strings.reversed().joinToString("")
    } else {
        strings.joinToString("")
    }
    return combinedString
}
/**
 * Given a list of strings and a boolean value, the function combines all the strings
 * in the list together. If the boolean value is true, the function reverses the order
 * of the strings before combining them.
 *
 * @param strings A list of strings.
 * @param boolValue A boolean value.
 * @return The combined string.
 *
 * Example:
 * combineStrings(listOf("Hello", "World", "Python"), false)
 * Output: "HelloWorldPython"
 *
 * combineStrings(listOf("Hello", "World", "Python"), true)
 * Output: "nohtyPdlroWolleH"
 */
fun combineStrings(strings: List<String>, boolValue: Boolean): String {
/**
 * Given a list of strings and a boolean value, the function combines all the strings
 * in the list together. If the boolean value is true, the function reverses the order
 * of the strings before combining them.
 *
 * @param strings A list of strings.
 * @param boolValue A boolean value.
 * @return The combined string.
 *
 * Example:
 * combineStrings(listOf("Hello", "World", "Python"), false)
 * Output: "HelloWorldPython"
 *
 * combineStrings(listOf("Hello", "World", "Python"), true)
 * Output: "nohtyPdlroWolleH"
 */
fun combineStrings(strings: List<String>, boolValue: Boolean): String {

    val combinedString = if (boolValue) {
        strings.reversed().joinToString("")
    } else {
        strings.joinToString("")
    }
    return combinedString
}