/**
 * This function takes a list of strings and a boolean expression as arguments.
 * It concatenates all the strings in the list if the boolean expression evaluates to True.
 * If the boolean expression evaluates to False, it concatenates all the strings in reverse order.
 * The resulting concatenated string is returned.
 *
 * @param strings A list of strings.
 * @param booleanExp A boolean expression.
 * @return Concatenated string based on the boolean expression.
 */
fun concatenateStrings(strings: List<String>, booleanExp: Boolean): String {

    var result = ""
    
    if (booleanExp) {
        for (string in strings) {
            result += string
        }
    } else {
        for (string in strings.reversed()) {
            result += string
        }
    }
    
    return result
}
/**
 * This function takes a list of strings and a boolean expression as arguments.
 * It concatenates all the strings in the list if the boolean expression evaluates to True.
 * If the boolean expression evaluates to False, it concatenates all the strings in reverse order.
 * The resulting concatenated string is returned.
 *
 * @param strings A list of strings.
 * @param booleanExp A boolean expression.
 * @return Concatenated string based on the boolean expression.
 */
fun concatenateStrings(strings: List<String>, booleanExp: Boolean): String {
/**
 * This function takes a list of strings and a boolean expression as arguments.
 * It concatenates all the strings in the list if the boolean expression evaluates to True.
 * If the boolean expression evaluates to False, it concatenates all the strings in reverse order.
 * The resulting concatenated string is returned.
 *
 * @param strings A list of strings.
 * @param booleanExp A boolean expression.
 * @return Concatenated string based on the boolean expression.
 */
fun concatenateStrings(strings: List<String>, booleanExp: Boolean): String {

    var result = ""
    
    if (booleanExp) {
        for (string in strings) {
            result += string
        }
    } else {
        for (string in strings.reversed()) {
            result += string
        }
    }
    
    return result
}